Class DefaultScpFileOpener

    • Field Detail

      • DEFAULT_SYNC_OPTIONS

        private static final java.nio.file.OpenOption[] DEFAULT_SYNC_OPTIONS
    • Constructor Detail

      • DefaultScpFileOpener

        public DefaultScpFileOpener()
    • Method Detail

      • openRead

        public java.io.InputStream openRead​(Session session,
                                            java.nio.file.Path file,
                                            long size,
                                            java.util.Set<java.nio.file.attribute.PosixFilePermission> permissions,
                                            java.nio.file.OpenOption... options)
                                     throws java.io.IOException
        Description copied from interface: ScpFileOpener
        Create an input stream to read from a file
        Specified by:
        openRead in interface ScpFileOpener
        Parameters:
        session - The Session requesting the access
        file - The requested local file Path
        size - The expected transfer bytes count
        permissions - The requested file permissions
        options - The OpenOptions - may be null/empty
        Returns:
        The open InputStream never null
        Throws:
        java.io.IOException - If failed to open the file
      • openWrite

        public java.io.OutputStream openWrite​(Session session,
                                              java.nio.file.Path file,
                                              long size,
                                              java.util.Set<java.nio.file.attribute.PosixFilePermission> permissions,
                                              java.nio.file.OpenOption... options)
                                       throws java.io.IOException
        Description copied from interface: ScpFileOpener
        Create an output stream to write to a file
        Specified by:
        openWrite in interface ScpFileOpener
        Parameters:
        session - The Session requesting the access
        file - The requested local file Path
        size - The expected transfer byte count
        permissions - The requested file permissions
        options - The OpenOptions - may be null/empty
        Returns:
        The open OutputStream never null
        Throws:
        java.io.IOException - If failed to open the file
      • resolveOpenOptions

        protected java.nio.file.OpenOption[] resolveOpenOptions​(Session session,
                                                                java.nio.file.Path file,
                                                                long size,
                                                                java.util.Set<java.nio.file.attribute.PosixFilePermission> permissions,
                                                                java.nio.file.OpenOption... options)
                                                         throws java.io.IOException
        Throws:
        java.io.IOException