Class ChecksumAlgorithmHelper

java.lang.Object
org.eclipse.aether.spi.connector.checksum.ChecksumAlgorithmHelper

public final class ChecksumAlgorithmHelper extends Object
Helper for checksum operations.
Since:
1.8.0
  • Method Details

    • calculate

      public static Map<String,String> calculate(byte[] data, List<ChecksumAlgorithmFactory> factories) throws IOException
      Calculates checksums for specified data.
      Parameters:
      data - The content for which to calculate checksums, must not be null.
      factories - The checksum algorithm factories 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 - In case of any problem.
    • calculate

      public static Map<String,String> calculate(File file, List<ChecksumAlgorithmFactory> factories) throws IOException
      Calculates checksums for specified file.
      Parameters:
      file - The file for which to calculate checksums, must not be null.
      factories - The checksum algorithm factories 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 - In case of any problem.