Class SftpFileSystemAutomatic
java.lang.Object
java.nio.file.FileSystem
org.apache.sshd.common.file.util.BaseFileSystem<SftpPath>
org.apache.sshd.sftp.client.fs.SftpFileSystem
org.apache.sshd.sftp.client.fs.SftpFileSystemAutomatic
- All Implemented Interfaces:
Closeable, AutoCloseable, ClientSessionHolder, SessionContextHolder, SessionHolder<ClientSession>
An
SftpFileSystem that uses a provider function for its ClientSession so that it can continue to
function even if a session was closed. The provider is supposed to create a new session if the current one is not
open.-
Nested Class Summary
Nested classes/interfaces inherited from class SftpFileSystem
SftpFileSystem.DefaultGroupPrincipal, SftpFileSystem.DefaultUserPrincipal, SftpFileSystem.DefaultUserPrincipalLookupService, SftpFileSystem.SftpClientHandle, SftpFileSystem.SftpClientPool -
Field Summary
FieldsFields inherited from class SftpFileSystem
OWNED_SESSION, UNIVERSAL_SUPPORTED_VIEWSFields inherited from class BaseFileSystem
log -
Constructor Summary
ConstructorsConstructorDescriptionSftpFileSystemAutomatic(SftpFileSystemProvider provider, String id, IOFunction<Boolean, ClientSession> sessionProvider, SftpClientFactory factory, SftpVersionSelector selector, SftpErrorDataHandler errorDataHandler) -
Method Summary
Methods inherited from class SftpFileSystem
close, create, getClient, getDefaultDir, getFileStores, getId, getReadBufferSize, getSession, getSftpErrorDataHandler, getSftpVersionSelector, getUserPrincipalLookupService, getVersion, getWriteBufferSize, init, isOpen, provider, setClientSession, setReadBufferSize, setWriteBufferSize, supportedFileAttributeViews, toStringMethods inherited from class BaseFileSystem
appendDedupSep, create, create, getPath, getPathMatcher, getRootDirectories, getSeparator, globToRegex, handleWindowsSeparator, hostFsHasWindowsSeparator, isReadOnly, newWatchServiceMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface SessionHolder
getSessionContext
-
Field Details
-
sessionProvider
-
-
Constructor Details
-
SftpFileSystemAutomatic
public SftpFileSystemAutomatic(SftpFileSystemProvider provider, String id, IOFunction<Boolean, ClientSession> sessionProvider, SftpClientFactory factory, SftpVersionSelector selector, SftpErrorDataHandler errorDataHandler) throws IOException - Throws:
IOException
-
-
Method Details
-
getClientSession
- Specified by:
getClientSessionin interfaceClientSessionHolder- Overrides:
getClientSessionin classSftpFileSystem- Returns:
- The underlying
ClientSessionused
-
sessionForSftpClient
- Overrides:
sessionForSftpClientin classSftpFileSystem- Throws:
IOException
-