public class ProxyFile extends Object implements AbstractFile
| Modifier | Constructor and Description |
|---|---|
protected |
ProxyFile(com.maverick.sftp.SftpFile file,
com.sshtools.sftp.SftpClient sftp,
ProxyFileFactory factory) |
protected |
ProxyFile(String name,
com.sshtools.sftp.SftpClient sftp,
ProxyFileFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
void |
copyFrom(AbstractFile src)
Copy contain of source file to this file
|
boolean |
createFolder()
Create the folder in the server
|
boolean |
createNewFile()
Create the file in the server
|
boolean |
delete(boolean recursive)
Delete file or folder in the server
|
boolean |
exists()
Whether file or folder exist in the server
|
String |
getAbsolutePath()
Return the absolute path to the file
|
SftpFileAttributes |
getAttributes()
This method returns
SftpFileAttributes of the file |
String |
getCanonicalPath()
This method return Canonical path of the file
|
List<AbstractFile> |
getChildren()
This method return the list of Abstractfile this ProxyFile has.
|
AbstractFileFactory<? extends AbstractFile> |
getFileFactory() |
InputStream |
getInputStream() |
String |
getName() |
OutputStream |
getOutputStream() |
OutputStream |
getOutputStream(boolean append) |
boolean |
isDirectory() |
boolean |
isFile() |
boolean |
isHidden() |
boolean |
isReadable() |
boolean |
isWritable() |
long |
lastModified()
get the last modified time of the file.
|
long |
length()
get the size of the file
|
void |
moveTo(AbstractFile destination) |
AbstractFileRandomAccess |
openFile(boolean writeAccess)
This method is not supported
|
void |
refresh() |
AbstractFile |
resolveFile(String path) |
void |
setAttributes(SftpFileAttributes newAtt) |
boolean |
supportsRandomAccess()
random access is not supported
|
void |
truncate() |
protected ProxyFile(String name, com.sshtools.sftp.SftpClient sftp, ProxyFileFactory factory) throws com.maverick.sftp.SftpStatusException, SshException
name - : file or folder namesftp - : SftpClient instance representing the remore file systemSshExceptioncom.maverick.sftp.SftpStatusExceptionprotected ProxyFile(com.maverick.sftp.SftpFile file,
com.sshtools.sftp.SftpClient sftp,
ProxyFileFactory factory)
throws com.maverick.sftp.SftpStatusException,
SshException
com.maverick.sftp.SftpStatusExceptionSshExceptionpublic void copyFrom(AbstractFile src) throws IOException, PermissionDeniedException
copyFrom in interface AbstractFilesrc - : source in which data to be copied. It should a file.: - system throws IOException if the source is not a
file or unable to connect to source file.IOExceptionPermissionDeniedExceptionpublic boolean createFolder()
throws PermissionDeniedException,
IOException
createFolder in interface AbstractFilePermissionDeniedExceptionIOExceptionpublic boolean createNewFile()
throws PermissionDeniedException,
IOException
createNewFile in interface AbstractFilePermissionDeniedExceptionIOExceptionpublic boolean delete(boolean recursive)
throws IOException,
PermissionDeniedException
delete in interface AbstractFilerecrusive - : if the file is folder delete contain of folder recursivelythrows - IOExceptionIOExceptionPermissionDeniedExceptionpublic boolean exists()
throws IOException
exists in interface AbstractFilethrows - IOException if unable to connect to the serverIOExceptionpublic String getAbsolutePath() throws IOException, PermissionDeniedException
getAbsolutePath in interface AbstractFileIOExceptionPermissionDeniedExceptionpublic SftpFileAttributes getAttributes() throws FileNotFoundException, IOException, PermissionDeniedException
SftpFileAttributes of the filegetAttributes in interface AbstractFileSftpFileAttributesFileNotFoundExceptionIOExceptionPermissionDeniedExceptionpublic String getCanonicalPath() throws IOException, PermissionDeniedException
getCanonicalPath in interface AbstractFileIOExceptionPermissionDeniedExceptionpublic List<AbstractFile> getChildren() throws IOException, PermissionDeniedException
getChildren in interface AbstractFileIOExceptionPermissionDeniedExceptionpublic AbstractFileFactory<? extends AbstractFile> getFileFactory()
getFileFactory in interface AbstractFilepublic InputStream getInputStream() throws IOException
getInputStream in interface AbstractFileIOExceptionpublic String getName()
getName in interface AbstractFilepublic OutputStream getOutputStream() throws IOException
getOutputStream in interface AbstractFileIOExceptionpublic OutputStream getOutputStream(boolean append) throws IOException
getOutputStream in interface AbstractFileIOExceptionpublic boolean isDirectory()
throws IOException
isDirectory in interface AbstractFileIOExceptionpublic boolean isFile()
throws IOException
isFile in interface AbstractFileIOExceptionpublic boolean isHidden()
throws IOException
isHidden in interface AbstractFileIOExceptionpublic boolean isReadable()
throws IOException
isReadable in interface AbstractFileIOExceptionpublic boolean isWritable()
throws IOException
isWritable in interface AbstractFileIOExceptionpublic long lastModified()
throws IOException
lastModified in interface AbstractFileIOExceptionpublic long length()
throws IOException
length in interface AbstractFile: - IOException if unable to access remote fileIOExceptionpublic void moveTo(AbstractFile destination) throws IOException, PermissionDeniedException
moveTo in interface AbstractFileIOExceptionPermissionDeniedExceptionpublic AbstractFileRandomAccess openFile(boolean writeAccess) throws IOException
openFile in interface AbstractFileIOExceptionpublic void refresh()
refresh in interface AbstractFilepublic AbstractFile resolveFile(String path) throws IOException, PermissionDeniedException
resolveFile in interface AbstractFileIOExceptionPermissionDeniedExceptionpublic void setAttributes(SftpFileAttributes newAtt) throws IOException
setAttributes in interface AbstractFileIOExceptionpublic boolean supportsRandomAccess()
supportsRandomAccess in interface AbstractFilepublic void truncate()
throws PermissionDeniedException,
IOException
truncate in interface AbstractFilePermissionDeniedExceptionIOExceptionCopyright © 2025. All rights reserved.