public final class SmbFile extends SmbItem
PATH_SEPARATOR, ROOT_PATH| Constructor and Description |
|---|
SmbFile(SmbConnection smbConnection,
String pathName)
Create a new SMB file based on the SMB connection and the path name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
copyFileViaServerSideCopy(SmbFile destinationSmbFile)
Copy the current file to another file on the same server share via server side copy.
|
void |
createFile()
Create a new file.
|
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 SMB 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.
|
OutputStream |
getOutputStream(boolean appendContent)
Get the output stream of the file that can be used to upload and append content to this file.
|
SmbFile |
renameTo(String newFileName,
boolean replaceIfExist)
Rename the current item and return it as newly renamed item.
|
buildProperItemPath, getChangeTime, getCreationTime, getDiskShare, getLastAccessTime, getLastWriteTime, getName, getParentPath, getPath, getRootPath, getServerName, getShareName, getSmbConnection, getSmbPath, isDirectory, isExisting, isFile, isHidden, isRootPath, isValidSmbItemNamepublic SmbFile(SmbConnection smbConnection, String pathName)
smbConnection - SMB connectionpathName - Path namepublic void createFile()
public void deleteFile()
public void copyFileViaServerSideCopy(SmbFile destinationSmbFile) throws com.hierynomus.protocol.commons.buffer.Buffer.BufferException, com.hierynomus.protocol.transport.TransportException
destinationSmbFile - 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 OutputStream getOutputStream(boolean appendContent)
appendContent - Append content or overwrite itpublic long getFileSize()
public SmbFile renameTo(String newFileName, boolean replaceIfExist)
Copyright © 2022. All rights reserved.