Class ChecksumAlgorithmHelper
java.lang.Object
org.eclipse.aether.spi.connector.checksum.ChecksumAlgorithmHelper
Helper for checksum operations.
- Since:
- 1.8.0
-
Method Summary
Modifier and TypeMethodDescriptioncalculate(byte[] data, List<ChecksumAlgorithmFactory> factories) Calculates checksums for specified data.calculate(File file, List<ChecksumAlgorithmFactory> factories) Calculates checksums for specified file.calculate(Path path, List<ChecksumAlgorithmFactory> factories) Calculates checksums for specified file.
-
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 benull.factories- The checksum algorithm factories to use, must not benull.- 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 benull.factories- The checksum algorithm factories to use, must not benull.- 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(Path path, List<ChecksumAlgorithmFactory> factories) throws IOException Calculates checksums for specified file.- Parameters:
path- The file for which to calculate checksums, must not benull.factories- The checksum algorithm factories to use, must not benull.- 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.- Since:
- 2.0.0
-