Top Description Fields Methods
org.apache.sshd.sftp.client.fs

public Interface SftpFileSystemClientSessionInitializer

Imports
java.io.IOException, java.time.Duration, java.util.Map, org.apache.sshd.client.session.ClientSession, .ClientSessionCreator, org.apache.sshd.common.auth.PasswordHolder, .UsernameHolder, org.apache.sshd.common.session.SessionHeartbeatController, org.apache.sshd.common.util.io.functors.IOFunction, org.apache.sshd.sftp.client.SftpErrorDataHandler, .SftpVersionSelector

Provides user hooks into the process of creating a SftpFileSystem via a SftpFileSystemProvider.
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
public static final SftpFileSystemClientSessionInitializer

Method Summary

Modifier and TypeMethod and Description
public default void
public default ClientSession

Returns:

The created ClientSession
createClientSession
(SftpFileSystemProvider
The SftpFileSystemProvider instance requesting the session
provider
,
SftpFileSystemInitializationContext context)

Invoked by the SftpFileSystemProvider#newFileSystem(java.net.URI, Map) method in order to obtain an initial (non-authenticated) ClientSession.

public default SftpFileSystem

Returns:

The created SftpFileSystem
createSftpFileSystem
(SftpFileSystemProvider
The SftpFileSystemProvider instance requesting the session
provider
,
SftpFileSystemInitializationContext context, ClientSession
The authenticated ClientSession
session
,
SftpVersionSelector
The resolved SftpVersionSelector to use
selector
,
SftpErrorDataHandler
The SftpErrorDataHandler to handle incoming data through the error stream - if null the data is silently ignored
errorDataHandler
)
Deprecated since 2.10.1

Invoked by the SftpFileSystemProvider#newFileSystem(java.net.URI, Map) method in order to create the SftpFileSystem once session has been authenticated.

public default SftpFileSystem

Returns:

The created SftpFileSystem
createSftpFileSystem
(SftpFileSystemProvider
The SftpFileSystemProvider instance requesting the session
provider
,
SftpFileSystemInitializationContext context, IOFunction<Boolean, ClientSession>
A factory for authenticated ClientSessions
sessionProvider
,
SftpVersionSelector
The resolved SftpVersionSelector to use
selector
,
SftpErrorDataHandler
The SftpErrorDataHandler to handle incoming data through the error stream - if null the data is silently ignored
errorDataHandler
)

Invoked by the SftpFileSystemProvider#newFileSystem(java.net.URI, Map) method in order to create the SftpFileSystem once session has been authenticated.

Field Detail

DEFAULTback to summary
public static final SftpFileSystemClientSessionInitializer DEFAULT

Method Detail

authenticateClientSessionback to summary
public default void authenticateClientSession(SftpFileSystemProvider provider, SftpFileSystemInitializationContext context, ClientSession session) throws IOException

Invoked by the SftpFileSystemProvider#newFileSystem(java.net.URI, Map) method in order to authenticate the session obtained from createClientSession(SftpFileSystemProvider, SftpFileSystemInitializationContext)

Parameters
provider:SftpFileSystemProvider

The SftpFileSystemProvider instance requesting the session

context:SftpFileSystemInitializationContext

The initialization SftpFileSystemInitializationContext

session:ClientSession

The created ClientSession

Exceptions
IOException:
If failed to authenticate
createClientSessionback to summary
public default ClientSession createClientSession(SftpFileSystemProvider provider, SftpFileSystemInitializationContext context) throws IOException

Invoked by the SftpFileSystemProvider#newFileSystem(java.net.URI, Map) method in order to obtain an initial (non-authenticated) ClientSession.

Parameters
provider:SftpFileSystemProvider

The SftpFileSystemProvider instance requesting the session

context:SftpFileSystemInitializationContext

The initialization SftpFileSystemInitializationContext

Returns:ClientSession

The created ClientSession

Exceptions
IOException:
If failed to connect
createSftpFileSystemback to summary
public default SftpFileSystem createSftpFileSystem(SftpFileSystemProvider provider, SftpFileSystemInitializationContext context, ClientSession session, SftpVersionSelector selector, SftpErrorDataHandler errorDataHandler) throws IOException

Deprecated

since 2.10.1

Invoked by the SftpFileSystemProvider#newFileSystem(java.net.URI, Map) method in order to create the SftpFileSystem once session has been authenticated.

Parameters
provider:SftpFileSystemProvider

The SftpFileSystemProvider instance requesting the session

context:SftpFileSystemInitializationContext

The initialization SftpFileSystemInitializationContext

session:ClientSession

The authenticated ClientSession

selector:SftpVersionSelector

The resolved SftpVersionSelector to use

errorDataHandler:SftpErrorDataHandler

The SftpErrorDataHandler to handle incoming data through the error stream - if null the data is silently ignored

Returns:SftpFileSystem

The created SftpFileSystem

Annotations
@Deprecated
Exceptions
IOException:
If failed to create the file-system
createSftpFileSystemback to summary
public default SftpFileSystem createSftpFileSystem(SftpFileSystemProvider provider, SftpFileSystemInitializationContext context, IOFunction<Boolean, ClientSession> sessionProvider, SftpVersionSelector selector, SftpErrorDataHandler errorDataHandler) throws IOException

Invoked by the SftpFileSystemProvider#newFileSystem(java.net.URI, Map) method in order to create the SftpFileSystem once session has been authenticated.

Parameters
provider:SftpFileSystemProvider

The SftpFileSystemProvider instance requesting the session

context:SftpFileSystemInitializationContext

The initialization SftpFileSystemInitializationContext

sessionProvider:IOFunction<Boolean, ClientSession>

A factory for authenticated ClientSessions

selector:SftpVersionSelector

The resolved SftpVersionSelector to use

errorDataHandler:SftpErrorDataHandler

The SftpErrorDataHandler to handle incoming data through the error stream - if null the data is silently ignored

Returns:SftpFileSystem

The created SftpFileSystem

Exceptions
IOException:
If failed to create the file-system