Package org.apache.sshd.sftp.client.fs
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 org.apache.sshd.sftp.client.fs.SftpFileSystem
SftpFileSystem.DefaultGroupPrincipal, SftpFileSystem.DefaultUserPrincipal, SftpFileSystem.DefaultUserPrincipalLookupService, SftpFileSystem.SftpClientHandle, SftpFileSystem.SftpClientPool
-
Field Summary
FieldsFields inherited from class org.apache.sshd.sftp.client.fs.SftpFileSystem
OWNED_SESSION, UNIVERSAL_SUPPORTED_VIEWS
Fields inherited from class org.apache.sshd.common.file.util.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 org.apache.sshd.sftp.client.fs.SftpFileSystem
close, create, getClient, getDefaultDir, getFileStores, getId, getReadBufferSize, getSession, getSftpErrorDataHandler, getSftpVersionSelector, getUserPrincipalLookupService, getVersion, getWriteBufferSize, init, isOpen, provider, setClientSession, setReadBufferSize, setWriteBufferSize, supportedFileAttributeViews, toString
Methods inherited from class org.apache.sshd.common.file.util.BaseFileSystem
appendDedupSep, create, create, getPath, getPathMatcher, getRootDirectories, getSeparator, globToRegex, handleWindowsSeparator, hostFsHasWindowsSeparator, isReadOnly, newWatchService
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
-
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:
getClientSession
in interfaceClientSessionHolder
- Overrides:
getClientSession
in classSftpFileSystem
- Returns:
- The underlying
ClientSession
used
-
sessionForSftpClient
- Overrides:
sessionForSftpClient
in classSftpFileSystem
- Throws:
IOException
-