| |
|
| java.lang.Object org.purl.sword.base.ChecksumUtils
ChecksumUtils | public class ChecksumUtils (Code) | | Utility class that holds Checksum related methods.
author: Neil Taylor |
Method Summary | |
public static String | generateMD5(String filepath) Generate an MD5 hash for the file that is specified in the
filepath. | public static String | generateMD5(InputStream md5Stream) Generate an MD5 hash for the file that is specified in the
filepath. | public static String | generateMD5(byte[] bytes) Generate an MD5 hash for the file that is specified in the
filepath. | public static void | main(String[] args) |
generateMD5 | public static String generateMD5(String filepath) throws NoSuchAlgorithmException, IOException(Code) | | Generate an MD5 hash for the file that is specified in the
filepath. The hash is returned as a String representation.
Parameters: filepath - The path to the file to load. A string hash of the file. throws: NoSuchAlgorithmException - If the MD5 algorithm is not supported by the installed virtual machine. throws: IOException - If there is an error accessing the file. |
generateMD5 | public static String generateMD5(InputStream md5Stream) throws NoSuchAlgorithmException, IOException(Code) | | Generate an MD5 hash for the file that is specified in the
filepath. The hash is returned as a String representation.
Parameters: md5Stream - The InputStream to checksum. A string hash of the file. throws: NoSuchAlgorithmException - If the MD5 algorithm is not supported by the installed virtual machine. throws: IOException - If there is an error accessing the file. |
generateMD5 | public static String generateMD5(byte[] bytes) throws NoSuchAlgorithmException, IOException(Code) | | Generate an MD5 hash for the file that is specified in the
filepath. The hash is returned as a String representation.
Parameters: bytes - The byte array to checksum. A string hash of the file. throws: NoSuchAlgorithmException - If the MD5 algorithm is not supported by the installed virtual machine. throws: IOException - If there is an error accessing the file. |
|
|
|