Class RemoteFile

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class RemoteFile
    extends RemoteResource
    • Constructor Detail

      • RemoteFile

        public RemoteFile​(SFTPEngine requester,
                          java.lang.String path,
                          byte[] handle)
    • Method Detail

      • fetchAttributes

        public FileAttributes fetchAttributes()
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • length

        public long length()
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • setLength

        public void setLength​(long len)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • read

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

        protected Promise<Response,​SFTPException> asyncRead​(long fileOffset,
                                                                  int len)
                                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        public void write​(long fileOffset,
                          byte[] data,
                          int off,
                          int len)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • asyncWrite

        protected Promise<Response,​SFTPException> asyncWrite​(long fileOffset,
                                                                   byte[] data,
                                                                   int off,
                                                                   int len)
                                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • setAttributes

        public void setAttributes​(FileAttributes attrs)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • getOutgoingPacketOverhead

        public int getOutgoingPacketOverhead()