public final class SftpFileProxy extends Object
Instances of this class are not safe for use by multiple threads.
| Constructor and Description |
|---|
SftpFileProxy(SftpChannel channel,
String path)
Create a SFTP file proxy.
|
| Modifier and Type | Method and Description |
|---|---|
SftpFileProxy |
getChild(String name)
Get the child with the given name.
|
Collection<SftpFileProxy> |
getChildren()
Get the list of children.
|
SftpFileProxy |
getParent()
Get the parent.
|
boolean |
isDirectory()
Answer whether this is a directory.
|
boolean |
isRootDirectory()
Answer whether this is the root directory.
|
long |
lastModifiedInMillis()
Get the time stamp of the last file modification in milliseconds since 1.1.1970.
|
long |
lengthInBytes()
Get the current length of the file in bytes.
|
String |
toString() |
public SftpFileProxy(SftpChannel channel, String path) throws NotConnectedException
channel - The SFTP channelpath - The path to the file on the remote machineIllegalArgumentException - if the SFTP channel is nullIllegalArgumentException - if the path is null or blankNotConnectedException - if the SFTP channel is not connectedpublic final SftpFileProxy getChild(String name) throws NotConnectedException
name - The name of the childNotConnectedException - if the list of children cannot be fetchedpublic final Collection<SftpFileProxy> getChildren() throws NotConnectedException
NotConnectedException - if the list of children cannot be fetchedpublic final boolean isDirectory()
throws NotConnectedException
NotConnectedException - if the file attributes cannot be fetchedpublic final boolean isRootDirectory()
public final long lengthInBytes()
throws NotConnectedException
NotConnectedException - if the file attributes cannot be fetchedpublic final long lastModifiedInMillis()
throws NotConnectedException
NotConnectedException - if the file attributes cannot be fetchedpublic final SftpFileProxy getParent() throws NotConnectedException
NotConnectedException - in case of being not connectedCopyright © 2019. All rights reserved.