Top Description Constructors Methods
org.apache.sshd.sftp.client.extensions.helpers

public Class MD5FileExtensionImpl

extends AbstractMD5HashExtension
implements MD5FileExtension
Class Inheritance
All Implemented Interfaces
org.apache.sshd.sftp.client.extensions.MD5FileExtension, org.apache.sshd.sftp.client.extensions.SftpClientExtension, org.apache.sshd.sftp.client.SftpClientHolder, org.apache.sshd.common.OptionalFeature, org.apache.sshd.common.NamedResource
Imports
java.io.IOException, java.util.Collection, org.apache.sshd.sftp.client.RawSftpClient, .SftpClient, org.apache.sshd.sftp.client.extensions.MD5FileExtension, org.apache.sshd.sftp.common.SftpConstants

Implements "md5-hash" extension
Author
Apache MINA SSHD Project
See Also
DRAFT 09 - section 9.1.1

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public byte[]
getHash(String
The (remote) path
path
,
long
The offset to start calculating the hash
offset
,
long
The number of data bytes to calculate the hash on - if greater than available, then up to whatever is available
length
,
byte[]
A quick-hash of the 1st 2048 bytes - ignored if null/empty
quickHash
)

Implements org.apache.sshd.sftp.client.extensions.MD5FileExtension.getHash.

Inherited from org.apache.sshd.sftp.client.extensions.helpers.AbstractMD5HashExtension:
doGetHash

Constructor Detail

MD5FileExtensionImplback to summary
public MD5FileExtensionImpl(SftpClient client, RawSftpClient raw, Collection<String> extra)

Method Detail

getHashback to summary
public byte[] getHash(String path, long offset, long length, byte[] quickHash) throws IOException

Implements org.apache.sshd.sftp.client.extensions.MD5FileExtension.getHash.

Parameters
path:String

Doc from org.apache.sshd.sftp.client.extensions.MD5FileExtension.getHash.

The (remote) path

offset:long

Doc from org.apache.sshd.sftp.client.extensions.MD5FileExtension.getHash.

The offset to start calculating the hash

length:long

Doc from org.apache.sshd.sftp.client.extensions.MD5FileExtension.getHash.

The number of data bytes to calculate the hash on - if greater than available, then up to whatever is available

quickHash:byte[]

Doc from org.apache.sshd.sftp.client.extensions.MD5FileExtension.getHash.

A quick-hash of the 1st 2048 bytes - ignored if null/empty

Returns:byte[]

Doc from org.apache.sshd.sftp.client.extensions.MD5FileExtension.getHash.

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

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.sshd.sftp.client.extensions.MD5FileExtension.getHash.

If failed to calculate the hash