org.codehaus.plexus.digest
Interface Digester

All Known Implementing Classes:
AbstractDigester

public interface Digester

Create a digest for a file.

Author:
Brett Porter

Field Summary
static java.lang.String ROLE
           
 
Method Summary
 java.lang.String calc(java.io.File file)
          Calculate a checksum for a file.
 java.lang.String getAlgorithm()
          Get the algorithm used for the checksum.
 void verify(java.io.File file, java.lang.String checksum)
          Verify that a checksum is correct.
 

Field Detail

ROLE

public static final java.lang.String ROLE
Method Detail

getAlgorithm

public java.lang.String getAlgorithm()
Get the algorithm used for the checksum.

Returns:
the algorithm

calc

public java.lang.String calc(java.io.File file)
                      throws DigesterException
Calculate a checksum for a file.

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(java.io.File file,
                   java.lang.String checksum)
            throws DigesterException
Verify that a checksum is correct.

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.


Copyright © 2001-2007 Codehaus. All Rights Reserved.