Class DigestUtils

java.lang.Object
org.codehaus.plexus.digest.DigestUtils

public class DigestUtils extends Object
Parse files from checksum file formats.
Author:
Brett Porter
  • Method Details

    • cleanChecksum

      public static String cleanChecksum(String rawChecksum, Digester digester, String expectedFilename) throws DigesterException
      Take a raw checksum string and verify that it matches the expectedFilename and digester, then return the trimmed checksum string.
      Parameters:
      rawChecksum - the raw checksum string that may include the filename.
      digester - the expected digester for this checksum string.
      expectedFilename - a String object.
      Returns:
      the trimmed checksum string (no filename portion)
      Throws:
      DigesterException - if there was a problem verifying the checksum string.
    • cleanChecksum

      public static String cleanChecksum(String checksum, String algorithm, String path) throws DigesterException

      cleanChecksum.

      Parameters:
      checksum - a String object.
      algorithm - a String object.
      path - a String object.
      Returns:
      a String object.
      Throws:
      DigesterException - if any.