Package org.compiere.utils
Class DigestOfFile
java.lang.Object
org.compiere.utils.DigestOfFile
- Author:
- rlemeill, Michael Judd BF [ 2736817 ] - remove deprecated BASE64Encoder classes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondigestAsBase64(byte[] input) digestAsBase64(File file) byte[]digestAsByteArray(byte[] input) byte[]digestAsByteArray(File file) byte[]digestAsByteArray(InputStream inputStream) digestAsHex(byte[] input) digestAsHex(File file) digestAsHex(InputStream inputStream) static StringgetMD5Hash(byte[] input) Get md5 hash from byte[]static StringgetMD5Hash(File file) static StringgetMD5Hash(InputStream inputStream) static voidstatic booleanmd5HashCompare(File file1, File file2)
-
Constructor Details
-
DigestOfFile
- Parameters:
algorithm- ie MD5- Throws:
Exception
-
-
Method Details
-
digestAsByteArray
- Parameters:
file- to hash- Returns:
- hash
- Throws:
Exception
-
digestAsByteArray
- Parameters:
inputStream-- Returns:
- md5 hash
- Throws:
Exception
-
digestAsByteArray
- Throws:
Exception
-
digestAsBase64
- Parameters:
file-- Returns:
- hash (base64 encoded)
- Throws:
Exception
-
digestAsBase64
- Parameters:
input-- Returns:
- hash (base64 encoded)
- Throws:
Exception
-
digestAsHex
- Parameters:
file-- Returns:
- hex encoded md5 string
- Throws:
Exception
-
digestAsHex
- Parameters:
inputStream-- Returns:
- hex encoded md5 string
- Throws:
Exception
-
digestAsHex
- Parameters:
input-- Returns:
- hex encoded md5 string
- Throws:
Exception
-
main
- Parameters:
args- file
-
md5HashCompare
- Parameters:
file1- first file to comparefile2- second file to compare- Returns:
- true if files are identic false otherwise
-
getMD5Hash
- Parameters:
file-- Returns:
- md5 hash null if file is not found or other error
-
getMD5Hash
- Parameters:
inputStream-- Returns:
- md5 hash
-
getMD5Hash
Get md5 hash from byte[]- Parameters:
input-- Returns:
- mdg hash string
-