com.mindbright.ssh2
public static final class SSH2SFTP.FileHandle extends java.lang.Object
SSH2SFTPClient
Modifier and Type | Field and Description |
---|---|
protected long |
lastOffset
This is used by SSH2SFTPClient to protect against out-of
order packets.
|
Modifier | Constructor and Description |
---|---|
protected |
SSH2SFTP.FileHandle(java.lang.String name,
byte[] handle,
boolean isDirectory)
Construct a new FileHandle with the provided data
|
Modifier and Type | Method and Description |
---|---|
void |
addAsyncListener(SSH2SFTP.AsyncListener listener)
Register a listener which will be notified when
asynchronous operations ends.
|
protected void |
asyncClose()
Close an asynchronous file.
|
protected void |
asyncEnd(int len)
An asynchronous operation has completed
|
protected void |
asyncException(SSH2SFTP.SFTPException e)
Got an asyncronous exception
|
protected void |
asyncProgress(int len)
Update progress
|
protected void |
asyncReadEOF()
Got an asyncronous EOF from server.
|
protected void |
asyncStart(int len)
An asynchronous operation has been started
|
protected boolean |
asyncWait(int reqLeft,
int timeout)
Wait until there is less than a certain number of
asynchronous operations outstanding.
|
protected byte[] |
getHandle()
Get the sftp protocol handle
|
java.lang.String |
getName()
Get name of underlying file.
|
java.lang.String |
getParentDir()
Get name of parent dir.
|
java.lang.String |
getShortName()
Get the short name of underlying file.
|
boolean |
isDirectory()
Check if thius handle refers to a directory.
|
boolean |
isOpen()
Check if this handle is open or not
|
java.lang.String |
toString()
Create a string representation of this object
|
protected volatile long lastOffset
protected SSH2SFTP.FileHandle(java.lang.String name, byte[] handle, boolean isDirectory)
name
- name of filehandle
- handle to use in sftp protocolisDirectory
- true if this is a directorypublic boolean isDirectory()
public boolean isOpen()
public java.lang.String getName()
public java.lang.String getShortName()
public java.lang.String getParentDir()
protected byte[] getHandle()
public void addAsyncListener(SSH2SFTP.AsyncListener listener)
protected void asyncStart(int len)
protected void asyncEnd(int len)
protected void asyncProgress(int len)
protected void asyncReadEOF()
protected void asyncException(SSH2SFTP.SFTPException e)
protected void asyncClose()
protected boolean asyncWait(int reqLeft, int timeout) throws SSH2SFTP.SFTPException
SSH2SFTP.SFTPException
public java.lang.String toString()
toString
in class java.lang.Object