Class FileHandle

    • Field Detail

      • access

        private final int access
      • fileChannel

        private final java.nio.channels.SeekableByteChannel fileChannel
      • locks

        private final java.util.List<java.nio.channels.FileLock> locks
      • openOptions

        private final java.util.Set<java.nio.file.StandardOpenOption> openOptions
      • fileAttributes

        private final java.util.Collection<java.nio.file.attribute.FileAttribute<?>> fileAttributes
    • Constructor Detail

      • FileHandle

        public FileHandle​(SftpSubsystem subsystem,
                          java.nio.file.Path file,
                          java.lang.String handle,
                          int flags,
                          int access,
                          java.util.Map<java.lang.String,​java.lang.Object> attrs)
                   throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • getOpenOptions

        public final java.util.Set<java.nio.file.StandardOpenOption> getOpenOptions()
      • getFileAttributes

        public final java.util.Collection<java.nio.file.attribute.FileAttribute<?>> getFileAttributes()
      • getFileChannel

        public java.nio.channels.SeekableByteChannel getFileChannel()
      • getAccessMask

        public int getAccessMask()
      • isOpenAppend

        public boolean isOpenAppend()
      • read

        public int read​(byte[] data,
                        long offset)
                 throws java.io.IOException
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] data,
                        int doff,
                        int length,
                        long offset)
                 throws java.io.IOException
        Throws:
        java.io.IOException
      • append

        public void append​(byte[] data)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • append

        public void append​(byte[] data,
                           int doff,
                           int length)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] data,
                          long offset)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] data,
                          int doff,
                          int length,
                          long offset)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.nio.channels.Channel
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class Handle
        Throws:
        java.io.IOException
      • lock

        public void lock​(long offset,
                         long length,
                         int mask)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • unlock

        public void unlock​(long offset,
                           long length)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • toFileAttributes

        public static java.util.Collection<java.nio.file.attribute.FileAttribute<?>> toFileAttributes​(java.util.Map<java.lang.String,​?> attrs)
      • toFileAttribute

        public static java.nio.file.attribute.FileAttribute<?> toFileAttribute​(java.lang.String key,
                                                                               java.lang.Object val)
      • getOpenOptions

        public static java.util.Set<java.nio.file.StandardOpenOption> getOpenOptions​(int flags,
                                                                                     int access)