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 SftpFileSystemInitializationContextprivate AtomicReference<ClientSession> private final Charset -
Constructor Summary
ConstructorsConstructorDescriptionSessionProvider(SftpFileSystemInitializationContext context, Map<String, ?> params, Charset decodingCharset) -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the currentClientSessionand optionally creates a new one if there is no current session yet, or if it is not open.private ClientSessioncreate()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 currentClientSessionand optionally creates a new one if there is no current session yet, or if it is not open.- Specified by:
applyin interfaceIOFunction<Boolean,ClientSession> - Parameters:
create-Boolean.TRUEto create a new session if needed, otherwise just query the current session.- Throws:
IOException
-
create
- Throws:
IOException
-