public class MD5Sum
extends java.lang.Object
The 128 bit MD5 hash is converted into a 32 character long String. Each character of the String is the hexadecimal representation of 4 bits of the digest. XXX The API here is a mess. It is combining a static utility class with a message digest API. Some methods which should be static are not, presumably so Jelly can easily access them.
Constructor and Description |
---|
MD5Sum() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
encode(byte[] binaryData)
Encodes the 128 bit (16 bytes) MD5 into a 32 character String.
|
void |
execute()
Perform the MD5-Sum work.
|
byte[] |
getBytes(java.io.File file)
Pull in static content and store it
|
java.lang.String |
getChecksum()
Get the checksum
|
java.io.File |
getFile()
Get the file that the checksum will be perform on.
|
void |
setChecksum(java.lang.String checksum)
Set the checksum
|
void |
setFile(java.io.File file)
Set the file to perform the checksum on.
|
public void setFile(java.io.File file)
file
- The file.public java.io.File getFile()
public void setChecksum(java.lang.String checksum)
checksum
- The checksum.public java.lang.String getChecksum()
public java.lang.String encode(byte[] binaryData)
binaryData
- Array containing the digestpublic byte[] getBytes(java.io.File file) throws java.lang.Exception
file
- The file to read.java.lang.Exception
- If an error occurs reading in the file's bytes.public void execute() throws java.lang.Exception
java.lang.Exception
- If an error occurs while calculating the sum.Copyright © 2001-2013 Apache Software Foundation. All Rights Reserved.