Class MD5FileExtensionImpl

All Implemented Interfaces:
NamedResource, OptionalFeature, MD5FileExtension, SftpClientExtension, RawSftpClient, SftpClientHolder

public class MD5FileExtensionImpl extends AbstractMD5HashExtension implements MD5FileExtension
Implements "md5-hash" extension
See Also:
  • Constructor Details

  • Method Details

    • getHash

      public byte[] getHash(String path, long offset, long length, byte[] quickHash) throws IOException
      Specified by:
      getHash in interface MD5FileExtension
      Parameters:
      path - The (remote) path
      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:
      IOException - If failed to calculate the hash