org.codehaus.plexus.digest
public class ChecksumFile extends java.lang.Object
Constructor and Description |
---|
ChecksumFile() |
Modifier and Type | Method and Description |
---|---|
java.io.File |
createChecksum(java.io.File referenceFile,
Digester digester)
Creates a checksum file of the provided referenceFile.
|
boolean |
isValidChecksum(java.io.File checksumFile)
Given a checksum file, check to see if the file it represents is valid according to the checksum.
|
public boolean isValidChecksum(java.io.File checksumFile) throws DigesterException, java.io.FileNotFoundException, 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 checksum file (must end in ".sha1" or ".md5")DigesterException
- if there is a digester problem during the check of the reference file.java.io.FileNotFoundException
- if the checksumFile itself or the file it refers to is not found.java.io.IOException
- if the reading of the checksumFile or the file it refers to fails.public java.io.File createChecksum(java.io.File referenceFile, Digester digester) throws DigesterException, java.io.IOException
referenceFile
- the file to checksum.digester
- the digester to use.DigesterException
- if there was a problem calculating the checksum of the referenceFile.java.io.IOException
- if there was a problem either reading the referenceFile, or writing the checksum file.Copyright © 2014. All Rights Reserved.