org.eclipse.aether.util

## Class ChecksumUtils

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

-     public final class ChecksumUtils
      extends Object

  A utility class to assist in the verification and generation of checksums.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Map<String,Object>` | `calc(File dataFile, Collection<String> algos)` Calculates checksums for the specified file.
    `static String` | `read(File checksumFile)` Extracts the checksum from the specified file.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### read

          public static String read(File checksumFile)
                             throws IOException

      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

          public static Map<String,Object> calc(File dataFile,
                                Collection<String> algos)
                                         throws IOException

      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.

Copyright © 2010-2012 The Eclipse Foundation. All Rights Reserved.