Class ChecksumUtils

java.lang.Object
org.eclipse.aether.util.ChecksumUtils

@Deprecated public final class ChecksumUtils extends Object
Deprecated.
the use of class should be avoided, see StringDigestUtil and file processor in SPI module
A utility class to assist in the verification and generation of checksums.
  • Method Details

    • read

      @Deprecated public static String read(File checksumFile) throws IOException
      Deprecated.
      use SPI FileProcessor to read and write checksum files
      Extracts the checksum from the specified file.
      Parameters:
      checksumFile - the path to the checksum file, must not be null
      Returns:
      the checksum stored in the file, never null
      Throws:
      IOException - if the checksum does not exist or could not be read for other reasons
    • calc

      @Deprecated public static Map<String,Object> calc(File dataFile, Collection<String> algos) throws IOException
      Deprecated.
      use SPI checksum selector instead
      Calculates checksums for the specified file.
      Parameters:
      dataFile - the file for which to calculate checksums, must not be null
      algos - the names of checksum algorithms (cf. MessageDigest.getInstance(String) to use, must not be null.
      Returns:
      the calculated checksums, indexed by algorithm name, or the exception that occurred while trying to calculate it, never null
      Throws:
      IOException - if the data file could not be read
    • calc

      @Deprecated public static Map<String,Object> calc(byte[] dataBytes, Collection<String> algos) throws IOException
      Deprecated.
      use SPI checksum selector instead
      Throws:
      IOException
    • toHexString

      public static String toHexString(byte[] bytes)
      Deprecated.
      Creates a hexadecimal representation of the specified bytes. Each byte is converted into a two-digit hex number and appended to the result with no separator between consecutive bytes.
      Parameters:
      bytes - the bytes to represent in hex notation, may be be null
      Returns:
      the hexadecimal representation of the input or null if the input was null
    • fromHexString

      public static byte[] fromHexString(String hexString)
      Deprecated.
      Creates a byte array out of hexadecimal representation of the specified bytes. If input string is null, null is returned. Input value must have even length (due hex encoding = 2 chars one byte).
      Parameters:
      hexString - the hexString to convert to byte array, may be null
      Returns:
      the byte array of the input or null if the input was null
      Since:
      1.8.0