Package org.apache.ivy.util
Class ChecksumHelper
java.lang.Object
org.apache.ivy.util.ChecksumHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
byteArrayToHexString
(byte[] in) Convert a byte[] array to readable string format.static void
Checks the checksum of the given file against the given checksumFile, and throws an IOException if the checksum is not compliantstatic String
computeAsString
(File f, String algorithm) static boolean
isKnownAlgorithm
(String algorithm)
-
Method Details
-
check
Checks the checksum of the given file against the given checksumFile, and throws an IOException if the checksum is not compliant- Parameters:
dest
- the file to testchecksumFile
- the file containing the expected checksumalgorithm
- the checksum algorithm to use- Throws:
IOException
- if an IO problem occur while reading files or if the checksum is not compliant
-
computeAsString
- Throws:
IOException
-
isKnownAlgorithm
-
byteArrayToHexString
Convert a byte[] array to readable string format. This makes the "hex" readable!- Parameters:
in
- byte[] buffer to convert to string format- Returns:
- result String buffer in String format
-