org.apache.tools.ant.types.selectors.modifiedselector
Class ChecksumAlgorithm
java.lang.Object
org.apache.tools.ant.types.selectors.modifiedselector.ChecksumAlgorithm
- Algorithm
public class ChecksumAlgorithm
extends java.lang.Object
Computes a 'checksum' for the content of file using
java.util.zip.CRC32 and java.util.zip.Adler32.
Use of this algorithm doesn't require any additional nested
name | values | description | required |
---|
algorithm.algorithm | ADLER | CRC ( default ) | name of the algorithm the checksum should use | no, defaults to CRC |
String | getValue(File file) - Computes a value for a file content with the specified checksum algorithm.
|
void | initChecksum() - Initialize the checksum interface.
|
boolean | isValid() - This algorithm supports only CRC and Adler.
|
void | setAlgorithm(String algorithm) - Specifies the algorithm to be used to compute the checksum.
|
String | toString() - Override Object.toString().
|
getValue
public String getValue(File file)
Computes a value for a file content with the specified checksum algorithm.
- getValue in interface Algorithm
file
- File object for which the value should be evaluated.
initChecksum
public void initChecksum()
Initialize the checksum interface.
isValid
public boolean isValid()
This algorithm supports only CRC and Adler.
- 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 "CRC". Other popular algorithms like "ADLER" may be used as well.
algorithm
- the digest algorithm to use
toString
public String toString()
Override Object.toString().
- some information about this algorithm.