Class CheckFileHandleExtensionImpl
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.sftp.client.extensions.helpers.AbstractSftpClientExtension
org.apache.sshd.sftp.client.extensions.helpers.AbstractCheckFileExtension
org.apache.sshd.sftp.client.extensions.helpers.CheckFileHandleExtensionImpl
- All Implemented Interfaces:
NamedResource, OptionalFeature, CheckFileHandleExtension, SftpClientExtension, RawSftpClient, SftpClientHolder
public class CheckFileHandleExtensionImpl
extends AbstractCheckFileExtension
implements CheckFileHandleExtension
Implements "check-file-handle" extension
- See Also:
-
Field Summary
Fields inherited from class AbstractLoggingBean
logFields inherited from interface NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTORFields inherited from interface OptionalFeature
FALSE, TRUE -
Constructor Summary
ConstructorsConstructorDescriptionCheckFileHandleExtensionImpl(SftpClient client, RawSftpClient raw, Collection<String> extras) -
Method Summary
Modifier and TypeMethodDescriptionAbstractMap.SimpleImmutableEntry<String, Collection<byte[]>> checkFileHandle(SftpClient.Handle handle, Collection<String> algorithms, long startOffset, long length, int blockSize) Methods inherited from class AbstractCheckFileExtension
doGetHashMethods inherited from class AbstractSftpClientExtension
checkExtendedReplyBuffer, checkStatus, getClient, getCommandBuffer, getCommandBuffer, getCommandBuffer, getName, isSupported, putTarget, receive, receive, receive, send, sendAndCheckExtendedCommandStatus, sendExtendedCommand, throwStatusException, writeMethods inherited from class AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface NamedResource
getNameMethods inherited from interface OptionalFeature
isSupportedMethods inherited from interface SftpClientHolder
getClient
-
Constructor Details
-
CheckFileHandleExtensionImpl
public CheckFileHandleExtensionImpl(SftpClient client, RawSftpClient raw, Collection<String> extras)
-
-
Method Details
-
checkFileHandle
public AbstractMap.SimpleImmutableEntry<String, Collection<byte[]>> checkFileHandle(SftpClient.Handle handle, Collection<String> algorithms, long startOffset, long length, int blockSize) throws IOException - Specified by:
checkFileHandlein interfaceCheckFileHandleExtension- Parameters:
handle- Remote fileSftpClient.Handle- must be a file and opened for readalgorithms- Hash algorithms in preferred orderstartOffset- Start offset of the hashlength- Length of data to hash - if zero then till EOFblockSize- Input block size to calculate individual hashes - if zero the one hash of all the data- Returns:
- An immutable
Map.Entrywhere key=hash algorithm name, value=the calculated hashes. - Throws:
IOException- If failed to execute the command
-