Package org.apache.sshd.sftp.client.fs
Interface SftpFileSystemClientSessionInitializer
-
public interface SftpFileSystemClientSessionInitializerProvides user hooks into the process of creating aSftpFileSystemvia aSftpFileSystemProvider.
-
-
Field Summary
Fields Modifier and Type Field Description static SftpFileSystemClientSessionInitializerDEFAULT
-
Method Summary
-
-
-
Field Detail
-
DEFAULT
static final SftpFileSystemClientSessionInitializer DEFAULT
-
-
Method Detail
-
createClientSession
default ClientSession createClientSession(SftpFileSystemProvider provider, SftpFileSystemInitializationContext context) throws java.io.IOException
Invoked by theSftpFileSystemProvider.newFileSystem(java.net.URI, Map)method in order to obtain an initial (non-authenticated)ClientSession.- Parameters:
provider- TheSftpFileSystemProviderinstance requesting the sessioncontext- The initializationSftpFileSystemInitializationContext- Returns:
- The created
ClientSession - Throws:
java.io.IOException- If failed to connect
-
authenticateClientSession
default void authenticateClientSession(SftpFileSystemProvider provider, SftpFileSystemInitializationContext context, ClientSession session) throws java.io.IOException
Invoked by theSftpFileSystemProvider.newFileSystem(java.net.URI, Map)method in order to authenticate the session obtained fromcreateClientSession(SftpFileSystemProvider, SftpFileSystemInitializationContext)- Parameters:
provider- TheSftpFileSystemProviderinstance requesting the sessioncontext- The initializationSftpFileSystemInitializationContextsession- The createdClientSession- Throws:
java.io.IOException- If failed to authenticate
-
createSftpFileSystem
@Deprecated default SftpFileSystem createSftpFileSystem(SftpFileSystemProvider provider, SftpFileSystemInitializationContext context, ClientSession session, SftpVersionSelector selector, SftpErrorDataHandler errorDataHandler) throws java.io.IOException
Deprecated.since 2.10.1Invoked by theSftpFileSystemProvider.newFileSystem(java.net.URI, Map)method in order to create theSftpFileSystemonce session has been authenticated.- Parameters:
provider- TheSftpFileSystemProviderinstance requesting the sessioncontext- The initializationSftpFileSystemInitializationContextsession- The authenticatedClientSessionselector- The resolvedSftpVersionSelectorto useerrorDataHandler- TheSftpErrorDataHandlerto handle incoming data through the error stream - ifnullthe data is silently ignored- Returns:
- The created
SftpFileSystem - Throws:
java.io.IOException- If failed to create the file-system
-
createSftpFileSystem
default SftpFileSystem createSftpFileSystem(SftpFileSystemProvider provider, SftpFileSystemInitializationContext context, IOFunction<java.lang.Boolean,ClientSession> sessionProvider, SftpVersionSelector selector, SftpErrorDataHandler errorDataHandler) throws java.io.IOException
Invoked by theSftpFileSystemProvider.newFileSystem(java.net.URI, Map)method in order to create theSftpFileSystemonce session has been authenticated.- Parameters:
provider- TheSftpFileSystemProviderinstance requesting the sessioncontext- The initializationSftpFileSystemInitializationContextsessionProvider- A factory for authenticatedClientSessionsselector- The resolvedSftpVersionSelectorto useerrorDataHandler- TheSftpErrorDataHandlerto handle incoming data through the error stream - ifnullthe data is silently ignored- Returns:
- The created
SftpFileSystem - Throws:
java.io.IOException- If failed to create the file-system
-
-