public class DefaultSftpClient extends AbstractSftpClient
| Modifier and Type | Class and Description |
|---|---|
protected class |
DefaultSftpClient.SftpChannelSubsystem |
SftpClient.Attribute, SftpClient.Attributes, SftpClient.CloseableHandle, SftpClient.CopyMode, SftpClient.DirEntry, SftpClient.Handle, SftpClient.OpenModeINIT_COMMAND_SIZElogDEFAULT_CHANNEL_MODES, EMPTY_DIR_ENTRIES, IO_BUFFER_SIZE, MIN_BUFFER_SIZE, MIN_READ_BUFFER_SIZE, MIN_WRITE_BUFFER_SIZEBY_NAME_COMPARATOR, NAME_EXTRACTOR| Constructor and Description |
|---|
DefaultSftpClient(ClientSession clientSession,
SftpVersionSelector initialVersionSelector) |
canonicalPath, checkAttributes, checkAttributesResponse, checkCommandStatus, checkData, checkDataResponse, checkDirResponse, checkHandle, checkHandleResponse, checkOneName, checkOneNameResponse, checkResponseStatus, checkResponseStatus, close, getChannel, getExtension, getExtension, getParsedServerExtensions, getParsedServerExtensions, getReadBufferSize, getReferencedName, getWriteBufferSize, handleUnexpectedAttributesPacket, handleUnexpectedHandlePacket, handleUnexpectedPacket, handleUnknownDataPacket, handleUnknownDirListingPacket, handleUnknownOneNamePacket, link, listDir, lock, lstat, mkdir, open, openDir, openRemoteFileChannel, putReferencedName, read, read, read, readAttributes, readDir, readDir, readLink, remove, rename, rmdir, setStat, setStat, stat, stat, throwStatusException, unlock, validateIncomingResponse, write, write, write, writeAttributestoStringdebug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsingleSessionInstancegetExtension, getName, open, open, openRemoteFileChannel, openRemotePathChannel, openRemotePathChannel, read, read, read, read, read, read, read, readDir, readEntries, rename, rename, singleSessionInstance, symLink, write, write, write, write, writegetSessiongetSessionContextfindByName, findFirstMatchByName, getNameList, getNames, ofName, removeByName, safeCompareByNamepublic DefaultSftpClient(ClientSession clientSession, SftpVersionSelector initialVersionSelector) throws IOException
clientSession - The ClientSessioninitialVersionSelector - The initial SftpVersionSelector - if null then version 6 is
assumed.IOException - If failed to initializepublic int getVersion()
public ClientSession getClientSession()
public ClientChannel getClientChannel()
public NavigableMap<String,byte[]> getServerExtensions()
NavigableMap of the reported server extensions. where key=extension name (case
insensitive)public Charset getNameDecodingCharset()
null) Charset used to decode referenced files/folders namesSftpModuleProperties.NAME_DECODING_CHARSETpublic void setNameDecodingCharset(Charset nameDecodingCharset)
public boolean isClosing()
public boolean isOpen()
public void close()
throws IOException
IOExceptionprotected 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(org.apache.sshd.common.util.buffer.Buffer incoming) throws IOException
incoming - The received Buffertrue if data from incoming buffer was processedIOException - if failed to process the bufferprocess(Buffer)protected void process(org.apache.sshd.common.util.buffer.Buffer incoming) throws IOException
incoming - The received BufferIOException - if failed to process the bufferpublic int send(int cmd,
org.apache.sshd.common.util.buffer.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 org.apache.sshd.common.util.buffer.Buffer receive(int id) throws IOException
id - The expected request idBuffer containing the request idIOException - If connection closed or interruptedpublic org.apache.sshd.common.util.buffer.Buffer receive(int id, long idleTimeout) throws IOException
id - The expected request ididleTimeout - The amount of time to wait for the responseBuffer containing the request idIOException - If connection closed or interruptedpublic org.apache.sshd.common.util.buffer.Buffer receive(int id, Duration idleTimeout) throws IOException
id - The expected request ididleTimeout - The amount of time to wait for the responseBuffer containing the request idIOException - If connection closed or interruptedprotected void init(ClientSession session, SftpVersionSelector initialVersionSelector, Duration initializationTimeout) throws IOException
IOExceptionprotected void handleInitResponse(org.apache.sshd.common.util.buffer.Buffer buffer) throws IOException
IOExceptionprotected org.apache.sshd.common.util.buffer.Buffer waitForInitResponse(Duration initializationTimeout) throws IOException
IOExceptionpublic int negotiateVersion(SftpVersionSelector selector) throws IOException
selector - The SftpVersionSelector to use - ignored if nullIOException - If failed to negotiateprotected ChannelSubsystem createSftpChannelSubsystem(ClientSession clientSession)
Copyright © 2018–2021 The Apache Software Foundation. All rights reserved.