|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.purl.sword.base.ChecksumUtils
public class ChecksumUtils
Utility class that holds Checksum related methods.
| Constructor Summary | |
|---|---|
ChecksumUtils()
|
|
| Method Summary | |
|---|---|
static String |
generateMD5(byte[] bytes)
Generate an MD5 hash for the file that is specified in the filepath. |
static String |
generateMD5(InputStream md5Stream)
Generate an MD5 hash for the file that is specified in the filepath. |
static String |
generateMD5(String filepath)
Generate an MD5 hash for the file that is specified in the filepath. |
static void |
main(String[] args)
Run a simple test to process the file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ChecksumUtils()
| Method Detail |
|---|
public static String generateMD5(String filepath)
throws NoSuchAlgorithmException,
IOException
filepath - The path to the file to load.
NoSuchAlgorithmException - If the MD5 algorithm is
not supported by the installed virtual machine.
IOException - If there is an error accessing the file.
public static String generateMD5(InputStream md5Stream)
throws NoSuchAlgorithmException,
IOException
md5Stream - The InputStream to checksum.
NoSuchAlgorithmException - If the MD5 algorithm is
not supported by the installed virtual machine.
IOException - If there is an error accessing the file.
public static String generateMD5(byte[] bytes)
throws NoSuchAlgorithmException,
IOException
bytes - The byte array to checksum.
NoSuchAlgorithmException - If the MD5 algorithm is
not supported by the installed virtual machine.
IOException - If there is an error accessing the file.
public static void main(String[] args)
throws NoSuchAlgorithmException,
IOException
args - The command line arguments.
NoSuchAlgorithmException - If there was an error generating the MD5.
IOException - If there is an error accessing the file.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||