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

### Field Summary

### Fields inherited from interface org.codehaus.plexus.digest.Digester

`ROLE`

### Constructor Summary

Constructors
`protected` `AbstractDigester(StreamingDigester streamingDigester)`

### Method Summary

All Methods Instance Methods Concrete Methods
`String` `calc(File file)` Calculate a checksum for a file.
`String` `getAlgorithm()` Get the algorithm used for the checksum.
`String` `toString()`
`void` `verify(File file, String checksum)` Verify that a checksum is correct.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.codehaus.plexus.digest.Digester

`getFilenameExtension`

### Constructor Detail

#### AbstractDigester

    protected AbstractDigester(StreamingDigester streamingDigester)

### Method Detail

#### 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 for
  `checksum` - the checksum to compare to
Throws:
  `DigesterException` - if there was a problem computing the hashcode.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`