| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| public static class | Checksum.FormatElement
Helper class for the format attribute. |
| Modifier and Type | Field and Description |
|---|---|
| private String | algorithm
MessageDigest algorithm to be used. |
| private Map | allDigests
Holds checksums for all files (both calculated and cached on disk). |
| private static final int | |
| private static final int | |
| private File | file
File for which checksum is to be calculated. |
| private String | fileext
File Extension that is be to used to create or identify destination file |
| private boolean | forceOverwrite
Whether or not to create a new file. |
| private MessageFormat | format
Formatter for the checksum file. |
| private Hashtable | includeFileMap
Stores SourceFile, DestFile pairs and SourceFile, Property String pairs. |
| private boolean | isCondition
is this task being used as a nested condition element? |
| private MessageDigest | messageDigest
Message Digest instance |
| private static final int | |
| private String | property
Holds generated checksum and gets set as a Project Property. |
| private String | provider
MessageDigest Algorithm provider |
| private int | readBufferSize
Size of the read buffer to use. |
| private Map | relativeFilePaths
Holds relative file names for all files (always with a forward slash). |
| private Checksum. | resources
Resource Collection. |
| private File | todir
Root directory in which the checksum files will be written. |
| private String | totalproperty
Property where totalChecksum gets set. |
| private String | verifyProperty
Contains the result of a checksum verification. |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | addFileset(FileSet
a fileset of files to generate checksums for. set)Files to generate checksums for. |
| private void | |
| private String | |
| public static byte[] | Returns: the converted array of bytesan array of characters representing hexadecimal values data)Converts an array of characters representing hexadecimal values into an array of bytes of those same values. |
| public boolean | Returns: Returns true if the checksum verification test passed, false otherwise.Implements org. |
| public void | |
| private boolean | |
| private File | |
| private String | |
| private String | |
| public void | setAlgorithm(String
a algorithm)String valueSpecifies the algorithm to be used to compute the checksum. |
| public void | |
| public void | setFileext(String
a fileext)String valueSets the file extension that is be to used to create or identify destination file. |
| public void | setForceOverwrite(boolean
a forceOverwrite)boolean valueWhether or not to overwrite existing file irrespective of whether it is newer than the source file. |
| public void | setFormat(Checksum.
an eenumerated valueSelect the in/output pattern via a well know format name. |
| public void | |
| public void | |
| public void | setProvider(String
a provider)String valueSets the MessageDigest algorithm provider to be used to calculate the checksum. |
| public void | |
| public void | |
| public void | setTotalproperty(String
a totalproperty)String valueSets the property to hold the generated total checksum for all files. |
| public void | |
| private boolean |
| algorithm | back to summary |
|---|---|
| private String algorithm MessageDigest algorithm to be used. | |
| allDigests | back to summary |
|---|---|
| private Map<File, byte[]> allDigests Holds checksums for all files (both calculated and cached on disk). Key: java.util.File (source file) Value: java.lang.String (digest) | |
| BUFFER_SIZE | back to summary |
|---|---|
| private static final int BUFFER_SIZE | |
| BYTE_MASK | back to summary |
|---|---|
| private static final int BYTE_MASK | |
| file | back to summary |
|---|---|
| private File file File for which checksum is to be calculated. | |
| fileext | back to summary |
|---|---|
| private String fileext File Extension that is be to used to create or identify destination file | |
| forceOverwrite | back to summary |
|---|---|
| private boolean forceOverwrite Whether or not to create a new file.
Defaults to | |
| format | back to summary |
|---|---|
| private MessageFormat format Formatter for the checksum file. | |
| includeFileMap | back to summary |
|---|---|
| private Hashtable<File, Object> includeFileMap Stores SourceFile, DestFile pairs and SourceFile, Property String pairs. | |
| isCondition | back to summary |
|---|---|
| private boolean isCondition is this task being used as a nested condition element? | |
| messageDigest | back to summary |
|---|---|
| private MessageDigest messageDigest Message Digest instance | |
| NIBBLE | back to summary |
|---|---|
| private static final int NIBBLE | |
| property | back to summary |
|---|---|
| private String property Holds generated checksum and gets set as a Project Property. | |
| provider | back to summary |
|---|---|
| private String provider MessageDigest Algorithm provider | |
| readBufferSize | back to summary |
|---|---|
| private int readBufferSize Size of the read buffer to use. | |
| relativeFilePaths | back to summary |
|---|---|
| private Map<File, String> relativeFilePaths Holds relative file names for all files (always with a forward slash). This is used to calculate the total hash. Key: java.util.File (source file) Value: java.lang.String (relative file name) | |
| resources | back to summary |
|---|---|
| private Checksum. Resource Collection. | |
| todir | back to summary |
|---|---|
| private File todir Root directory in which the checksum files will be written. If not specified, the checksum files will be written in the same directory as each file. | |
| totalproperty | back to summary |
|---|---|
| private String totalproperty Property where totalChecksum gets set. | |
| verifyProperty | back to summary |
|---|---|
| private String verifyProperty Contains the result of a checksum verification. ("true" or "false") | |
| WORD | back to summary |
|---|---|
| private static final int WORD | |
| Checksum | back to summary |
|---|---|
| public Checksum() | |
| add | back to summary |
|---|---|
| public void add(ResourceCollection rc) Add a resource collection.
| |
| addFileset | back to summary |
|---|---|
| public void addFileset(FileSet set) Files to generate checksums for.
| |
| addToIncludeFileMap | back to summary |
|---|---|
| private void addToIncludeFileMap(File file) throws BuildException Add key-value pair to the hashtable upon which to later operate upon. | |
| createDigestString | back to summary |
|---|---|
| private String createDigestString(byte[] fileDigest) | |
| decodeHex | back to summary |
|---|---|
| public static byte[] decodeHex(char[] data) throws BuildException Converts an array of characters representing hexadecimal values into an array of bytes of those same values. The returned array will be half the length of the passed array, as it takes two characters to represent any given byte. An exception is thrown if the passed char array has an odd number of elements. Note This code is copied from jakarta-commons codec.
| |
| eval | back to summary |
|---|---|
| public boolean eval() throws BuildException Implements org. Calculate the checksum(s)
| |
| execute | back to summary |
|---|---|
| public void execute() throws BuildException Overrides org. Calculate the checksum(s).
| |
| generateChecksums | back to summary |
|---|---|
| private boolean generateChecksums() throws BuildException Generate checksum(s) using the message digest created earlier. | |
| getChecksumFile | back to summary |
|---|---|
| private File getChecksumFile(File file) | |
| getRelativeFilePath | back to summary |
|---|---|
private String getRelativeFilePath(File f)
| |
| readChecksum | back to summary |
|---|---|
| private String readChecksum(File f) reads the checksum from a file using the specified format.
| |
| setAlgorithm | back to summary |
|---|---|
| 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.
| |
| setFile | back to summary |
|---|---|
| public void setFile(File file) Sets the file for which the checksum is to be calculated.
| |
| setFileext | back to summary |
|---|---|
| public void setFileext(String fileext) Sets the file extension that is be to used to create or identify destination file.
| |
| setForceOverwrite | back to summary |
|---|---|
| public void setForceOverwrite(boolean forceOverwrite) Whether or not to overwrite existing file irrespective of whether it is newer than the source file. Defaults to false.
| |
| setFormat | back to summary |
|---|---|
| public void setFormat(Checksum. Select the in/output pattern via a well know format name.
| |
| setPattern | back to summary |
|---|---|
| public void setPattern(String pattern) Specify the pattern to use as a MessageFormat pattern. {0} gets replaced by the checksum, {1} by the filename.
| |
| setProperty | back to summary |
|---|---|
| public void setProperty(String property) Sets the property to hold the generated checksum.
| |
| setProvider | back to summary |
|---|---|
| public void setProvider(String provider) Sets the MessageDigest algorithm provider to be used to calculate the checksum.
| |
| setReadBufferSize | back to summary |
|---|---|
| public void setReadBufferSize(int size) The size of the read buffer to use.
| |
| setTodir | back to summary |
|---|---|
| public void setTodir(File todir) Sets the root directory where checksum files will be written/read
| |
| setTotalproperty | back to summary |
|---|---|
| public void setTotalproperty(String totalproperty) Sets the property to hold the generated total checksum for all files.
| |
| setVerifyproperty | back to summary |
|---|---|
| public void setVerifyproperty(String verifyProperty) Sets the verify property. This project property holds the result of a checksum verification - "true" or "false"
| |
| validateAndExecute | back to summary |
|---|---|
| private boolean validateAndExecute() throws BuildException Validate attributes and get down to business. | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | add(ResourceCollection
the ResourceCollection to add. rc)Overrides org. |
| u | back to summary |
|---|---|
| private Union u | |
| FileUnion | back to summary |
|---|---|
| pack-priv FileUnion() | |
| add | back to summary |
|---|---|
| public void add(ResourceCollection rc) Overrides org. Doc from org. Add the ResourceCollection.
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static HashMap | |
| private static final String | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static Checksum. | |
| public MessageFormat | |
| public String[] | Returns: an array of values.Implements abstract org. |
| CHECKSUM | back to summary |
|---|---|
| private static final String CHECKSUM | |
| formatMap | back to summary |
|---|---|
| private static HashMap<String, MessageFormat> formatMap | |
| MD5SUM | back to summary |
|---|---|
| private static final String MD5SUM | |
| SVF | back to summary |
|---|---|
| private static final String SVF | |
| FormatElement | back to summary |
|---|---|
| public FormatElement() | |
| getDefault | back to summary |
|---|---|
| public static Checksum. Get the default value - CHECKSUM.
| |
| getFormat | back to summary |
|---|---|
| public MessageFormat getFormat() Convert this enumerated type to a
| |
| getValues | back to summary |
|---|---|
| public String[] getValues() Implements abstract org. Get the valid values. | |