Package org.apache.sshd.sftp.client.fs
Class SftpFileSystem.Wrapper
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.client.subsystem.AbstractSubsystemClient
-
- org.apache.sshd.sftp.client.impl.AbstractSftpClient
-
- org.apache.sshd.sftp.client.fs.SftpFileSystem.DelegatingClient
-
- org.apache.sshd.sftp.client.fs.SftpFileSystem.Wrapper
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.nio.channels.Channel,ClientChannelHolder,ClientSessionHolder,SubsystemClient,ChannelHolder,NamedResource,SessionContextHolder,SessionHolder<ClientSession>,FullAccessSftpClient,RawSftpClient,SftpClient,SftpErrorDataHandler
- Enclosing class:
- SftpFileSystem
private class SftpFileSystem.Wrapper extends SftpFileSystem.DelegatingClient
The file system hands out only Wrapper instances to prevent the underlying SftpClient from being closed. The real SftpClient used will be closed when the SftpFileSystem is closed, or if the server terminates the channel, or the session is closed. In the latter two cases, operations using the old underlying SftpClient may fail. Subsequent operations on a non-closed SftpFileSystem will re-create an SftpClient (channel) and also an SSH session, if needed, and perform the operations on that new SftpClient.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.sshd.sftp.client.SftpClient
SftpClient.Attribute, SftpClient.Attributes, SftpClient.CloseableHandle, SftpClient.CopyMode, SftpClient.DirEntry, SftpClient.Handle, SftpClient.OpenMode
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicBooleanopen-
Fields inherited from class org.apache.sshd.sftp.client.fs.SftpFileSystem.DelegatingClient
delegate
-
Fields inherited from class org.apache.sshd.sftp.client.impl.AbstractSftpClient
errorDataHandler, INIT_COMMAND_SIZE, SFTP_CLIENT_CMD_TIMEOUT
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
Fields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR
-
Fields inherited from interface org.apache.sshd.sftp.client.SftpClient
DEFAULT_CHANNEL_MODES, EMPTY_DIR_ENTRIES, IO_BUFFER_SIZE, MIN_BUFFER_SIZE, MIN_READ_BUFFER_SIZE, MIN_WRITE_BUFFER_SIZE
-
Fields inherited from interface org.apache.sshd.sftp.client.SftpErrorDataHandler
EMPTY
-
-
Constructor Summary
Constructors Constructor Description Wrapper(SftpClient delegate, SftpErrorDataHandler errorHandler, int readSize, int writeSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleanisClosing()booleanisOpen()-
Methods inherited from class org.apache.sshd.sftp.client.fs.SftpFileSystem.DelegatingClient
canonicalPath, close, getClientChannel, getClientSession, getNameDecodingCharset, getServerExtensions, getVersion, link, listDir, lock, lstat, mkdir, open, openDir, put, put, put, put, put, put, read, read, read, read, readDir, readDir, readLink, receive, receive, receive, remove, rename, rmdir, send, setNameDecodingCharset, setStat, setStat, stat, stat, symLink, unlock, write, write, write, write, write
-
Methods inherited from class org.apache.sshd.sftp.client.impl.AbstractSftpClient
checkAttributes, checkAttributesResponse, checkCommandStatus, checkDataResponse, checkDirResponse, checkHandle, checkHandleResponse, checkOneName, checkOneNameResponse, checkResponseStatus, checkResponseStatus, errorData, getChannel, getExtension, getExtension, getParsedServerExtensions, getParsedServerExtensions, getReadBufferSize, getReferencedName, getWriteBufferSize, handleUnexpectedAttributesPacket, handleUnexpectedHandlePacket, handleUnexpectedPacket, handleUnknownDataPacket, handleUnknownDirListingPacket, handleUnknownOneNamePacket, openRemoteFileChannel, put, putReferencedName, read, read, readAttributes, readDir, response, rpc, throwStatusException, write, writeAttributes
-
Methods inherited from class org.apache.sshd.client.subsystem.AbstractSubsystemClient
toString
-
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.session.SessionHolder
getSessionContext
-
Methods inherited from interface org.apache.sshd.sftp.client.SftpClient
getExtension, getName, open, open, openRemoteFileChannel, openRemotePathChannel, openRemotePathChannel, put, put, put, put, put, read, read, read, read, readEntries, rename, rename, singleSessionInstance, write, write, write
-
Methods inherited from interface org.apache.sshd.client.subsystem.SubsystemClient
getSession
-
-
-
-
Constructor Detail
-
Wrapper
Wrapper(SftpClient delegate, SftpErrorDataHandler errorHandler, int readSize, int writeSize)
-
-
Method Detail
-
isClosing
public boolean isClosing()
- Specified by:
isClosingin interfaceSftpClient- Overrides:
isClosingin classSftpFileSystem.DelegatingClient
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin interfacejava.nio.channels.Channel- Overrides:
isOpenin classSftpFileSystem.DelegatingClient
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.nio.channels.Channel- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classSftpFileSystem.DelegatingClient- Throws:
java.io.IOException
-
-