org.apache.tools.ant.types.selectors.modifiedselector
Class DigestAlgorithm
java.lang.Object
org.apache.tools.ant.types.selectors.modifiedselector.DigestAlgorithm
- Algorithm
public class DigestAlgorithm
extends java.lang.Object
Computes a 'hashvalue' for the content of file using
java.security.MessageDigest.
Use of this algorithm doesn't require any additional nested
name | values | description | required |
---|
algorithm.algorithm | MD5 | SHA (default provider) | name of the algorithm the provider should use | no, defaults to MD5 |
algorithm.provider | | name of the provider to use | no, defaults to null |
String | getValue(File file) - Computes a value for a file content with the specified digest algorithm.
|
void | initMessageDigest() - Initialize the security message digest.
|
boolean | isValid() - This algorithm doesn't need any configuration.
|
void | setAlgorithm(String algorithm) - Specifies the algorithm to be used to compute the checksum.
|
void | setProvider(String provider) - Sets the MessageDigest algorithm provider to be used
to calculate the checksum.
|
String | toString() - Override Object.toString().
|
getValue
public String getValue(File file)
Computes a value for a file content with the specified digest algorithm.
- getValue in interface Algorithm
file
- File object for which the value should be evaluated.
initMessageDigest
public void initMessageDigest()
Initialize the security message digest.
isValid
public boolean isValid()
This algorithm doesn't need any configuration.
Therefore it's always valid.
- isValid in interface Algorithm
- true if all is ok, otherwise false.
setAlgorithm
public void setAlgorithm(String algorithm)
Specifies the algorithm to be used to compute the checksum.
Defaults to "MD5". Other popular algorithms like "SHA" may be used as well.
algorithm
- the digest algorithm to use
setProvider
public void setProvider(String provider)
Sets the MessageDigest algorithm provider to be used
to calculate the checksum.
provider
- provider to use
toString
public String toString()
Override Object.toString().
- some information about this algorithm.
Copyright B) 2000-2006 Apache Software Foundation. All Rights Reserved.