public final class SftpFileAttributes extends Object implements ConnectedTestable
Instances of this class are not safe for use by multiple threads.
| Constructor and Description |
|---|
SftpFileAttributes(SftpChannel channel,
String path)
Create a new SFTP file attributes object.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
fileExists()
Answer whether the file exists.
|
String |
getPath()
Get the file path.
|
boolean |
isConnected()
Answer whether this object is currently connected.
|
boolean |
isFile()
Answer whether the file is a normal (regular) file and not a directory, link or any other.
|
boolean |
isValid()
Answer whether this object contains valid values.
|
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.
|
void |
refresh()
Refresh the content of this object.
|
public SftpFileAttributes(SftpChannel channel, String path)
channel - The SFTP channelpath - The file pathIllegalArgumentException - if the SFTP channel is nullIllegalArgumentException - if the path is null or blankpublic final String getPath()
public final void refresh()
public final boolean isConnected()
ConnectedTestableisConnected in interface ConnectedTestablepublic final boolean isValid()
public final boolean fileExists()
public final long lengthInBytes()
public final long lastModifiedInMillis()
public final boolean isFile()
Copyright © 2019. All rights reserved.