org.codehaus.plexus.digest
Class AbstractDigester
java.lang.Object
org.codehaus.plexus.digest.AbstractDigester
- All Implemented Interfaces:
- Digester
- Direct Known Subclasses:
- Md5Digester, Sha1Digester
public abstract class AbstractDigester
- extends Object
- implements Digester
Create a digest for a file.
- Author:
- Brett Porter
Fields inherited from interface org.codehaus.plexus.digest.Digester |
ROLE |
AbstractDigester
protected AbstractDigester(StreamingDigester streamingDigester)
getAlgorithm
public String getAlgorithm()
- Description copied from interface:
Digester
- Get the algorithm used for the checksum.
- Specified by:
getAlgorithm
in interface Digester
- Returns:
- the algorithm
calc
public String calc(File file)
throws DigesterException
- Description copied from interface:
Digester
- Calculate a checksum for a file.
- Specified by:
calc
in interface Digester
- Parameters:
file
- the file to calculate the checksum for
- Returns:
- the current checksum.
- Throws:
DigesterException
- if there was a problem computing the hashcode.
verify
public void verify(File file,
String checksum)
throws DigesterException
- Description copied from interface:
Digester
- Verify that a checksum is correct.
- Specified by:
verify
in interface Digester
- Parameters:
file
- the file to compute the checksum forchecksum
- the checksum to compare to
- Throws:
DigesterException
- if there was a problem computing the hashcode.
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2001-2011 Codehaus. All Rights Reserved.