Package org.apache.maven.wagon.observers
Class ChecksumObserver
java.lang.Object
org.apache.maven.wagon.observers.ChecksumObserver
- All Implemented Interfaces:
TransferListener
TransferListeners which computes MD5 checksum on the fly when files are transfered.
- Author:
- Michal Maczka
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected String
encode
(byte[] binaryData) Encodes a 128 bit or 160-bit byte array into a String.Returns md5 checksum which was computed during transfervoid
transferCompleted
(TransferEvent transferEvent) void
transferError
(TransferEvent transferEvent) void
transferInitiated
(TransferEvent transferEvent) void
transferProgress
(TransferEvent transferEvent, byte[] buffer, int length) void
transferStarted
(TransferEvent transferEvent)
-
Constructor Details
-
ChecksumObserver
- Throws:
NoSuchAlgorithmException
-
ChecksumObserver
- Parameters:
algorithm
- One of the algorithms supported by JDK: MD5, MD2 or SHA-1- Throws:
NoSuchAlgorithmException
-
-
Method Details
-
transferInitiated
- Specified by:
transferInitiated
in interfaceTransferListener
-
transferStarted
- Specified by:
transferStarted
in interfaceTransferListener
- See Also:
-
transferProgress
- Specified by:
transferProgress
in interfaceTransferListener
- See Also:
-
transferCompleted
- Specified by:
transferCompleted
in interfaceTransferListener
-
transferError
- Specified by:
transferError
in interfaceTransferListener
-
debug
- Specified by:
debug
in interfaceTransferListener
-
getActualChecksum
Returns md5 checksum which was computed during transfer- Returns:
-
encode
Encodes a 128 bit or 160-bit byte array into a String.- Parameters:
binaryData
- Array containing the digest- Returns:
- Encoded hex string, or null if encoding failed
-