public class MessageDigestFileDigester extends AbstractFileDigester
FileDigester that streams the content of files to a MessageDigest.| Modifier and Type | Field and Description |
|---|---|
protected MessageDigest |
messageDigest
The
MessageDigest instance. |
algorithmSTREAMING_BUFFER_SIZE| Modifier | Constructor and Description |
|---|---|
protected |
MessageDigestFileDigester(String algorithm)
Build a new instance of
MessageDigestFileDigester. |
| Modifier and Type | Method and Description |
|---|---|
String |
calculate(File file)
Calculate a checksum for a file.
|
getAlgorithm, getFileExtensionprotected final MessageDigest messageDigest
MessageDigest instance.protected MessageDigestFileDigester(String algorithm) throws NoSuchAlgorithmException
MessageDigestFileDigester.algorithm - the algorithm used to compute checksum digests.NoSuchAlgorithmException - in case the given is not supported.public String calculate(File file) throws DigesterException
file - the file to compute the checksum for.DigesterException - if there was a problem computing the hashcode.Copyright © 2010–2016. All rights reserved.