Package org.apache.sshd.sftp.client.fs
Interface SftpFileSystemClientSessionInitializer
public interface SftpFileSystemClientSessionInitializer
Provides user hooks into the process of creating a
SftpFileSystem
via a SftpFileSystemProvider
.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault void
authenticateClientSession
(SftpFileSystemProvider provider, SftpFileSystemInitializationContext context, ClientSession session) Invoked by theSftpFileSystemProvider.newFileSystem(java.net.URI, Map)
method in order to authenticate the session obtained fromcreateClientSession(SftpFileSystemProvider, SftpFileSystemInitializationContext)
default ClientSession
createClientSession
(SftpFileSystemProvider provider, SftpFileSystemInitializationContext context) Invoked by theSftpFileSystemProvider.newFileSystem(java.net.URI, Map)
method in order to obtain an initial (non-authenticated)ClientSession
.default SftpFileSystem
createSftpFileSystem
(SftpFileSystemProvider provider, SftpFileSystemInitializationContext context, ClientSession session, SftpVersionSelector selector, SftpErrorDataHandler errorDataHandler) Deprecated.since 2.10.1default SftpFileSystem
createSftpFileSystem
(SftpFileSystemProvider provider, SftpFileSystemInitializationContext context, IOFunction<Boolean, ClientSession> sessionProvider, SftpVersionSelector selector, SftpErrorDataHandler errorDataHandler) Invoked by theSftpFileSystemProvider.newFileSystem(java.net.URI, Map)
method in order to create theSftpFileSystem
once session has been authenticated.
-
Field Details
-
DEFAULT
-
-
Method Details
-
createClientSession
default ClientSession createClientSession(SftpFileSystemProvider provider, SftpFileSystemInitializationContext context) throws IOException Invoked by theSftpFileSystemProvider.newFileSystem(java.net.URI, Map)
method in order to obtain an initial (non-authenticated)ClientSession
.- Parameters:
provider
- TheSftpFileSystemProvider
instance requesting the sessioncontext
- The initializationSftpFileSystemInitializationContext
- Returns:
- The created
ClientSession
- Throws:
IOException
- If failed to connect
-
authenticateClientSession
default void authenticateClientSession(SftpFileSystemProvider provider, SftpFileSystemInitializationContext context, ClientSession session) throws IOException Invoked by theSftpFileSystemProvider.newFileSystem(java.net.URI, Map)
method in order to authenticate the session obtained fromcreateClientSession(SftpFileSystemProvider, SftpFileSystemInitializationContext)
- Parameters:
provider
- TheSftpFileSystemProvider
instance requesting the sessioncontext
- The initializationSftpFileSystemInitializationContext
session
- The createdClientSession
- Throws:
IOException
- If failed to authenticate
-
createSftpFileSystem
@Deprecated default SftpFileSystem createSftpFileSystem(SftpFileSystemProvider provider, SftpFileSystemInitializationContext context, ClientSession session, SftpVersionSelector selector, SftpErrorDataHandler errorDataHandler) throws IOException Deprecated.since 2.10.1Invoked by theSftpFileSystemProvider.newFileSystem(java.net.URI, Map)
method in order to create theSftpFileSystem
once session has been authenticated.- Parameters:
provider
- TheSftpFileSystemProvider
instance requesting the sessioncontext
- The initializationSftpFileSystemInitializationContext
session
- The authenticatedClientSession
selector
- The resolvedSftpVersionSelector
to useerrorDataHandler
- TheSftpErrorDataHandler
to handle incoming data through the error stream - ifnull
the data is silently ignored- Returns:
- The created
SftpFileSystem
- Throws:
IOException
- If failed to create the file-system
-
createSftpFileSystem
default SftpFileSystem createSftpFileSystem(SftpFileSystemProvider provider, SftpFileSystemInitializationContext context, IOFunction<Boolean, ClientSession> sessionProvider, SftpVersionSelector selector, SftpErrorDataHandler errorDataHandler) throws IOExceptionInvoked by theSftpFileSystemProvider.newFileSystem(java.net.URI, Map)
method in order to create theSftpFileSystem
once session has been authenticated.- Parameters:
provider
- TheSftpFileSystemProvider
instance requesting the sessioncontext
- The initializationSftpFileSystemInitializationContext
sessionProvider
- A factory for authenticatedClientSession
sselector
- The resolvedSftpVersionSelector
to useerrorDataHandler
- TheSftpErrorDataHandler
to handle incoming data through the error stream - ifnull
the data is silently ignored- Returns:
- The created
SftpFileSystem
- Throws:
IOException
- If failed to create the file-system
-