com.mindbright.ssh2
protected static final class SSH2SFTP.SFTPPacket extends SSH2DataBuffer implements NIOCallback
BOOLEAN_FALSE, BOOLEAN_TRUE, data, rPos, wPos
Constructor and Description |
---|
SSH2SFTP.SFTPPacket() |
Modifier and Type | Method and Description |
---|---|
void |
asyncRead(NonBlockingInput in,
SSH2SFTP.Callback callback) |
void |
completed(java.nio.ByteBuffer buf)
Called once the network read operation has been completed
|
void |
connected(boolean timeout)
Called once the connection has been established (assuming
interest for this has been registered by calling the
NotifyWhenConnected method of Switchboard ). |
void |
connectionFailed(java.lang.Exception e)
Called if the connection failed (assuming
interest for this has been registered by calling the
NotifyWhenConnected method of Switchboard ). |
void |
failsafeReadFrom(NonBlockingInput in,
int timeout)
Failsafe read method.
|
int |
getId() |
int |
getLength() |
int |
getType() |
SSH2SFTP.FileAttributes |
readAttrs() |
void |
readFailed(java.lang.Exception e)
Called if the read failed
|
void |
readFrom(NonBlockingInput in,
int timeout) |
SSH2SFTP.FileSystemAttributes |
readFSAttrs() |
void |
reset(int type,
int id) |
void |
writeAttrs(SSH2SFTP.FileAttributes attrs) |
void |
writeFailed()
Called if the write failed
|
void |
writeTo(NonBlockingOutput out) |
getData, getMaxReadSize, getMaxSize, getMaxWriteSize, getRPos, getWPos, readBigInt, readBigIntBits, readBoolean, readByte, readInt, readJavaString, readLong, readRaw, readRaw, readRestRaw, readString, readString, readUInt, reset, resize, setData, setRPos, setWPos, writeBigInt, writeBigIntBits, writeBoolean, writeByte, writeInt, writeInt, writeLong, writeRaw, writeRaw, writeString, writeString, writeString, writeUTF8String
public void reset(int type, int id)
public int getType()
public int getId()
public int getLength()
public void writeAttrs(SSH2SFTP.FileAttributes attrs)
public SSH2SFTP.FileAttributes readAttrs()
public SSH2SFTP.FileSystemAttributes readFSAttrs()
public void failsafeReadFrom(NonBlockingInput in, int timeout) throws SSH2SFTP.SFTPException
This is useful when reading the first version packet which is small but may be, on broken systems, preceded by some ascii characters.
in
- Stream to read data fromtimeout
- TimeoutSSH2SFTP.SFTPException
public void readFrom(NonBlockingInput in, int timeout) throws SSH2SFTP.SFTPException
SSH2SFTP.SFTPException
public void asyncRead(NonBlockingInput in, SSH2SFTP.Callback callback) throws SSH2SFTP.SFTPException
SSH2SFTP.SFTPException
public void writeTo(NonBlockingOutput out) throws SSH2SFTP.SFTPException
SSH2SFTP.SFTPException
public void completed(java.nio.ByteBuffer buf)
NIOCallback
completed
in interface NIOCallback
buf
- the buffer provided to the read callpublic void readFailed(java.lang.Exception e)
NIOCallback
readFailed
in interface NIOCallback
public void writeFailed()
NIOCallback
writeFailed
in interface NIOCallback
public void connected(boolean timeout)
NIOCallback
NotifyWhenConnected
method of Switchboard
).connected
in interface NIOCallback
timeout
- true if the connection attempt timed outpublic void connectionFailed(java.lang.Exception e)
NIOCallback
NotifyWhenConnected
method of Switchboard
).connectionFailed
in interface NIOCallback
e
- the exception the connection failed with.