Class ChecksumHelper

java.lang.Object
org.apache.ivy.util.ChecksumHelper

public final class ChecksumHelper extends Object
  • Method Details

    • check

      public static void check(File dest, File checksumFile, String algorithm) throws IOException
      Checks the checksum of the given file against the given checksumFile, and throws an IOException if the checksum is not compliant
      Parameters:
      dest - the file to test
      checksumFile - the file containing the expected checksum
      algorithm - the checksum algorithm to use
      Throws:
      IOException - if an IO problem occur while reading files or if the checksum is not compliant
    • computeAsString

      public static String computeAsString(File f, String algorithm) throws IOException
      Throws:
      IOException
    • isKnownAlgorithm

      public static boolean isKnownAlgorithm(String algorithm)
    • byteArrayToHexString

      public static String byteArrayToHexString(byte[] in)
      Convert a byte[] array to readable string format. This makes the "hex" readable!
      Parameters:
      in - byte[] buffer to convert to string format
      Returns:
      result String buffer in String format