public final class SharedFile extends AbstractSharedItem<SharedDirectory>
PATH_SEPARATOR, ROOT_PATH| Constructor and Description |
|---|
SharedFile(SharedConnection sharedConnection,
String pathName)
Create a new shared file based on the shared connection and the path name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
copyFileViaServerSideCopy(SharedFile destinationSharedFile)
Copy the current file to another file on the same server share via server side copy.
|
void |
createFile()
Create a new file.
|
protected SharedDirectory |
createSharedNodeItem(String pathName)
Create a new shared directory via factory.
|
void |
deleteFile()
Delete the current file.
|
boolean |
equals(Object object)
Check if the current and the given objects are equals.
|
long |
getFileSize()
Get the file size of the shared item.
|
InputStream |
getInputStream()
Get the input stream of the file that can be used to download the file.
|
OutputStream |
getOutputStream()
Get the output stream of the file that can be used to upload content to this file.
|
getChangeTime, getCreationTime, getDiskShare, getLastAccessTime, getLastWriteTime, getName, getParentPath, getPath, getRootPath, getServerName, getSharedConnection, getShareName, getSmbPath, isDirectory, isExisting, isFile, isRootPathpublic SharedFile(SharedConnection sharedConnection, String pathName)
sharedConnection - Shared connectionpathName - Path namepublic void createFile()
public void deleteFile()
public void copyFileViaServerSideCopy(SharedFile destinationSharedFile) throws com.hierynomus.protocol.commons.buffer.Buffer.BufferException, com.hierynomus.protocol.transport.TransportException
destinationSharedFile - Other file on the same server sharecom.hierynomus.protocol.commons.buffer.Buffer.BufferException - Buffer related exceptioncom.hierynomus.protocol.transport.TransportException - Transport related exceptionpublic InputStream getInputStream()
public OutputStream getOutputStream()
public long getFileSize()
public boolean equals(Object object)
equals in class AbstractSharedItem<SharedDirectory>object - Given object to compare againstprotected SharedDirectory createSharedNodeItem(String pathName)
createSharedNodeItem in class AbstractSharedItem<SharedDirectory>pathName - Path name of the shared itemCopyright © 2018. All rights reserved.