Class DigestAlgorithm
- java.lang.Object
- 
- org.apache.tools.ant.types.selectors.modifiedselector.DigestAlgorithm
 
- 
- All Implemented Interfaces:
- Algorithm
 
 public class DigestAlgorithm extends java.lang.Object implements Algorithm Computes a 'hashvalue' for the content of file using java.security.MessageDigest. Use of this algorithm doesn't require any additional nested <param>s. Supported <param>s are:Digest algorithm parameters 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 - Since:
- Ant 1.6
- Version:
- 2004-07-08
 
- 
- 
Constructor SummaryConstructors Constructor Description DigestAlgorithm()
 - 
Method SummaryModifier and Type Method Description java.lang.StringgetValue(java.io.File file)Computes a value for a file content with the specified digest algorithm.voidinitMessageDigest()Initialize the security message digest.booleanisValid()This algorithm supports only MD5 and SHA.voidsetAlgorithm(java.lang.String algorithm)Specifies the algorithm to be used to compute the checksum.voidsetProvider(java.lang.String provider)Sets the MessageDigest algorithm provider to be used to calculate the checksum.java.lang.StringtoString()Override Object.toString().
 
- 
- 
- 
Method Detail- 
setAlgorithmpublic void setAlgorithm(java.lang.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.- Parameters:
- algorithm- the digest algorithm to use
 
 - 
setProviderpublic void setProvider(java.lang.String provider) Sets the MessageDigest algorithm provider to be used to calculate the checksum.- Parameters:
- provider- provider to use
 
 - 
initMessageDigestpublic void initMessageDigest() Initialize the security message digest.
 - 
isValidpublic boolean isValid() This algorithm supports only MD5 and SHA.
 - 
getValuepublic java.lang.String getValue(java.io.File file) Computes a value for a file content with the specified digest algorithm.
 - 
toStringpublic java.lang.String toString() Override Object.toString().- Overrides:
- toStringin class- java.lang.Object
- Returns:
- some information about this algorithm.
 
 
- 
 
-