Class SftpHandle

java.lang.Object
com.sshtools.client.sftp.SftpHandle
All Implemented Interfaces:
Closeable, AutoCloseable

public final class SftpHandle extends Object implements Closeable
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close the handle.
    void
    copyTo(SftpHandle destinationHandle, com.sshtools.common.util.UnsignedInteger64 fromOffset, com.sshtools.common.util.UnsignedInteger64 length, com.sshtools.common.util.UnsignedInteger64 toOffset)
     
    boolean
     
    Get the attributes of a file.
    Get the file associated with this handle.
    byte[]
    Get the open file handle
    int
     
    boolean
    Determine whether the file is open.
    int
    List the children of a directory.
    Lock this file.
    lock(int lockFlags)
    Lock this file.
    lock(long offset, long length, int lockflags)
    Lock this file or a region of it.
    void
    performOptimizedRead(long length, int blocksize, OutputStream out, int outstandingRequests, FileTransferProgress progress, long position)
    Performs an optimized read of a file through use of asynchronous messages.
    void
    performOptimizedRead(String filename, long length, int blocksize, OutputStream out, int outstandingRequests, FileTransferProgress progress, long position)
    Deprecated, for removal: This API element is subject to removal in a future version. 
    void
    performOptimizedWrite(String filename, int blocksize, int maxAsyncRequests, InputStream in, int buffersize, FileTransferProgress progress, long position)
    Performs an optimized write of a file through asynchronous messaging and through buffering the local file into memory.
    void
    performSynchronousRead(int blocksize, OutputStream out, FileTransferProgress progress, long position)
    Perform a synchronous read of a file from the remote file system.
    com.sshtools.common.util.UnsignedInteger32
    postReadRequest(long offset, int len)
    Post a read request to the server and return the request id; this is used to optimize file downloads.
    com.sshtools.common.util.UnsignedInteger32
    postWriteRequest(long position, byte[] data, int off, int len)
    Send a write request for an open file but do not wait for the response from the server.
    int
    read(long offset, byte[] output, int outputOffset, int len)
    Read bytes directly from this file.
    int
    readFile(com.sshtools.common.util.UnsignedInteger64 offset, byte[] output, int off, int len)
    Read a block of data from an open file.
    void
    Sets the attributes of a file.
    void
    write(long offset, byte[] input, int inputOffset, int len)
    Write bytes directly to this file.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait