Class MD5HandleExtensionImpl

    • Constructor Detail

      • MD5HandleExtensionImpl

        public MD5HandleExtensionImpl​(SftpClient client,
                                      RawSftpClient raw,
                                      java.util.Collection<java.lang.String> extra)
    • Method Detail

      • getHash

        public byte[] getHash​(SftpClient.Handle handle,
                              long offset,
                              long length,
                              byte[] quickHash)
                       throws java.io.IOException
        Specified by:
        getHash in interface MD5HandleExtension
        Parameters:
        handle - The (remote) file Handle
        offset - The offset to start calculating the hash
        length - The number of data bytes to calculate the hash on - if greater than available, then up to whatever is available
        quickHash - A quick-hash of the 1st 2048 bytes - ignored if null/empty
        Returns:
        The hash value if the quick hash matches (or null/empty), or null/empty if the quick hash is provided and it does not match
        Throws:
        java.io.IOException - If failed to calculate the hash