public class DefaultSftpClient extends AbstractSftpClient
SftpClient.Attribute, SftpClient.Attributes, SftpClient.CloseableHandle, SftpClient.CopyMode, SftpClient.DirEntry, SftpClient.Handle, SftpClient.OpenMode
NamedResource.Utils
log
DEFAULT_CHANNEL_OPEN_TIMEOUT, DEFAULT_READ_BUFFER_SIZE, DEFAULT_WAIT_TIMEOUT, DEFAULT_WRITE_BUFFER_SIZE, IO_BUFFER_SIZE, MIN_BUFFER_SIZE, MIN_READ_BUFFER_SIZE, MIN_WRITE_BUFFER_SIZE, SFTP_CHANNEL_OPEN_TIMEOUT
BY_NAME_COMPARATOR, NAME_EXTRACTOR
Constructor and Description |
---|
DefaultSftpClient(ClientSession clientSession) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected int |
data(byte[] buf,
int start,
int len)
Receive binary data
|
ClientChannel |
getClientChannel() |
ClientSession |
getClientSession() |
Map<String,byte[]> |
getServerExtensions() |
int |
getVersion() |
protected void |
init(long initializationTimeout) |
boolean |
isClosing() |
boolean |
isOpen() |
int |
negotiateVersion(SftpVersionSelector selector) |
protected void |
process(Buffer incoming)
Process an SFTP packet
|
protected Buffer |
read() |
protected boolean |
receive(Buffer incoming)
Read SFTP packets from buffer
|
Buffer |
receive(int id) |
int |
send(int cmd,
Buffer buffer) |
canonicalPath, checkAttributes, checkAttributes, checkData, checkData, checkDir, checkHandle, checkHandle, checkOneName, checkOneName, checkStatus, checkStatus, checkStatus, close, getExtension, getExtension, getExtension, getName, getParsedServerExtensions, getParsedServerExtensions, handleUnexpectedAttributesPacket, handleUnexpectedHandlePacket, handleUnexpectedPacket, handleUnknownDataPacket, handleUnknownDirListingPacket, handleUnknownOneNamePacket, link, lock, lstat, mkdir, open, open, open, openDir, read, read, read, read, read, read, read, read, read, read, readAttributes, readDir, readDir, readDir, readLink, remove, rename, rename, rename, rmdir, setStat, setStat, stat, stat, symLink, throwStatusException, unlock, write, write, write, write, write, write, write, write, writeAttributes
getSession
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSession
public DefaultSftpClient(ClientSession clientSession) throws IOException
IOException
public int getVersion()
public ClientSession getClientSession()
ClientSession
usedpublic ClientChannel getClientChannel()
ClientChannel
usedpublic Map<String,byte[]> getServerExtensions()
Map
of the reported server extensions.public boolean isClosing()
public boolean isOpen()
public void close() throws IOException
IOException
protected int data(byte[] buf, int start, int len) throws IOException
buf
- The buffer for the incoming datastart
- Offset in buffer to place the datalen
- Available space in buffer for the dataIOException
- If failed to receive incoming dataprotected boolean receive(Buffer incoming) throws IOException
incoming
- The received Buffer
true
if data from incoming buffer was processedIOException
- if failed to process the bufferprocess(Buffer)
protected void process(Buffer incoming) throws IOException
incoming
- The received Buffer
IOException
- if failed to process the bufferpublic int send(int cmd, Buffer buffer) throws IOException
cmd
- Command to send - Note: only lower 8-bits are usedbuffer
- The Buffer
containing the command dataIOException
- if failed to send commandpublic Buffer receive(int id) throws IOException
id
- The expected request idBuffer
containing the request idIOException
- If connection closed or interruptedprotected Buffer read() throws IOException
IOException
protected void init(long initializationTimeout) throws IOException
IOException
public int negotiateVersion(SftpVersionSelector selector) throws IOException
selector
- The SftpVersionSelector
to useIOException
- If failed to negotiateCopyright © 2008–2016 The Apache Software Foundation. All rights reserved.