Package org.apache.sshd.sftp.client.fs
Class SftpFileSystemProvider.SessionProvider
java.lang.Object
org.apache.sshd.sftp.client.fs.SftpFileSystemProvider.SessionProvider
- All Implemented Interfaces:
IOFunction<Boolean,
ClientSession>
- Enclosing class:
SftpFileSystemProvider
private class SftpFileSystemProvider.SessionProvider
extends Object
implements IOFunction<Boolean,ClientSession>
A session provider that automatically creates a new session if the current one is no longer open (or if there
isn't one yet). It returns fully authenticated sessions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SftpFileSystemInitializationContext
private AtomicReference
<ClientSession> private final Charset
-
Constructor Summary
ConstructorsConstructorDescriptionSessionProvider
(SftpFileSystemInitializationContext context, Map<String, ?> params, Charset decodingCharset) -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the currentClientSession
and optionally creates a new one if there is no current session yet, or if it is not open.private ClientSession
create()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.sshd.common.util.io.functors.IOFunction
andThen, compose
-
Field Details
-
context
-
params
-
decodingCharset
-
currentSession
-
-
Constructor Details
-
SessionProvider
SessionProvider(SftpFileSystemInitializationContext context, Map<String, ?> params, Charset decodingCharset)
-
-
Method Details
-
apply
Retrieves the currentClientSession
and optionally creates a new one if there is no current session yet, or if it is not open.- Specified by:
apply
in interfaceIOFunction<Boolean,
ClientSession> - Parameters:
create
-Boolean.TRUE
to create a new session if needed, otherwise just query the current session.- Throws:
IOException
-
create
- Throws:
IOException
-