Interface Digester

All Known Implementing Classes:
AbstractDigester, Md5Digester, Sha1Digester, Sha256Digester

public interface Digester
Create a digest for a file.
Author:
Brett Porter
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Constant ROLE="Digester.class.getName()"
  • Method Summary

    Modifier and Type
    Method
    Description
    calc(File file)
    Calculate a checksum for a file.
    Get the algorithm used for the checksum.
    The filename extension for this digester.
    void
    verify(File file, String checksum)
    Verify that a checksum is correct.
  • Field Details

    • ROLE

      static final String ROLE
      Constant ROLE="Digester.class.getName()"
  • Method Details

    • getAlgorithm

      String getAlgorithm()
      Get the algorithm used for the checksum.
      Returns:
      the algorithm
    • getFilenameExtension

      String getFilenameExtension()
      The filename extension for this digester.
      Returns:
      the filename extension.
    • calc

      String calc(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

      void verify(File file, 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.