|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.archiva.checksum.ChecksummedFile
public class ChecksummedFile
ChecksummedFile
Constructor Summary | |
---|---|
ChecksummedFile(java.io.File referenceFile)
Construct a ChecksummedFile object. |
Method Summary | |
---|---|
java.lang.String |
calculateChecksum(ChecksumAlgorithm checksumAlgorithm)
Calculate the checksum based on a given checksum. |
java.io.File |
createChecksum(ChecksumAlgorithm checksumAlgorithm)
Creates a checksum file of the provided referenceFile. |
boolean |
fixChecksums(ChecksumAlgorithm[] algorithms)
Fix or create checksum files for the reference file. |
java.io.File |
getChecksumFile(ChecksumAlgorithm checksumAlgorithm)
Get the checksum file for the reference file and hash. |
boolean |
isValidChecksum(ChecksumAlgorithm algorithm)
Given a checksum file, check to see if the file it represents is valid according to the checksum. |
boolean |
isValidChecksums(ChecksumAlgorithm[] algorithms)
Of any checksum files present, validate that the reference file conforms the to the checksum. |
java.lang.String |
parseChecksum(java.lang.String rawChecksumString,
ChecksumAlgorithm expectedHash,
java.lang.String expectedPath)
Parse a checksum string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChecksummedFile(java.io.File referenceFile)
referenceFile
- Method Detail |
---|
public java.lang.String calculateChecksum(ChecksumAlgorithm checksumAlgorithm) throws java.io.IOException
checksumAlgorithm
- the algorithm to use.
java.io.IOException
- if unable to calculate the checksum.public java.io.File createChecksum(ChecksumAlgorithm checksumAlgorithm) throws java.io.IOException
checksumAlgorithm
- the hash to use.
java.io.IOException
- if there was a problem either reading the referenceFile, or writing the checksum file.public java.io.File getChecksumFile(ChecksumAlgorithm checksumAlgorithm)
checksumAlgorithm
- the hash that we are interested in.
public boolean isValidChecksum(ChecksumAlgorithm algorithm) throws java.io.IOException
Given a checksum file, check to see if the file it represents is valid according to the checksum.
NOTE: Only supports single file checksums of type MD5 or SHA1.
checksumFile
- the algorithms to check for.
java.io.IOException
- if the reading of the checksumFile or the file it refers to fails.public boolean isValidChecksums(ChecksumAlgorithm[] algorithms)
algorithms
- the algorithms to check for.
public boolean fixChecksums(ChecksumAlgorithm[] algorithms)
algorithms
- the hashes to check for.
public java.lang.String parseChecksum(java.lang.String rawChecksumString, ChecksumAlgorithm expectedHash, java.lang.String expectedPath) throws java.io.IOException
rawChecksumString
- expectedHash
- expectedPath
-
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |