Class SftpFileSystemProvider.SessionProvider

  • All Implemented Interfaces:
    IOFunction<java.lang.Boolean,​ClientSession>
    Enclosing class:
    SftpFileSystemProvider

    private class SftpFileSystemProvider.SessionProvider
    extends java.lang.Object
    implements IOFunction<java.lang.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 Detail

      • params

        private final java.util.Map<java.lang.String,​?> params
      • decodingCharset

        private final java.nio.charset.Charset decodingCharset
      • currentSession

        private java.util.concurrent.atomic.AtomicReference<ClientSession> currentSession
    • Constructor Detail

    • Method Detail

      • apply

        public ClientSession apply​(java.lang.Boolean create)
                            throws java.io.IOException
        Retrieves the current ClientSession and optionally creates a new one if there is no current session yet, or if it is not open.
        Specified by:
        apply in interface IOFunction<java.lang.Boolean,​ClientSession>
        Parameters:
        create - Boolean.TRUE to create a new session if needed, otherwise just query the current session.
        Throws:
        java.io.IOException
      • create

        private ClientSession create()
                              throws java.io.IOException
        Throws:
        java.io.IOException