Package org.eclipse.aether.util
Class ChecksumUtils
- java.lang.Object
-
- org.eclipse.aether.util.ChecksumUtils
-
@Deprecated public final class ChecksumUtils extends java.lang.Object
Deprecated.the use of class should be avoided, seeStringDigestUtiland file processor in SPI moduleA utility class to assist in the verification and generation of checksums.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.util.Map<java.lang.String,java.lang.Object>calc(byte[] dataBytes, java.util.Collection<java.lang.String> algos)Deprecated.use SPI checksum selector insteadstatic java.util.Map<java.lang.String,java.lang.Object>calc(java.io.File dataFile, java.util.Collection<java.lang.String> algos)Deprecated.use SPI checksum selector insteadstatic byte[]fromHexString(java.lang.String hexString)Deprecated.Creates a byte array out of hexadecimal representation of the specified bytes.static java.lang.Stringread(java.io.File checksumFile)Deprecated.use SPI FileProcessor to read and write checksum filesstatic java.lang.StringtoHexString(byte[] bytes)Deprecated.Creates a hexadecimal representation of the specified bytes.
-
-
-
Method Detail
-
read
@Deprecated public static java.lang.String read(java.io.File checksumFile) throws java.io.IOException
Deprecated.use SPI FileProcessor to read and write checksum filesExtracts the checksum from the specified file.- Parameters:
checksumFile- the path to the checksum file, must not benull- Returns:
- the checksum stored in the file, never
null - Throws:
java.io.IOException- if the checksum does not exist or could not be read for other reasons
-
calc
@Deprecated public static java.util.Map<java.lang.String,java.lang.Object> calc(java.io.File dataFile, java.util.Collection<java.lang.String> algos) throws java.io.IOException
Deprecated.use SPI checksum selector insteadCalculates checksums for the specified file.- Parameters:
dataFile- the file for which to calculate checksums, must not benullalgos- the names of checksum algorithms (cf.MessageDigest.getInstance(String)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:
java.io.IOException- if the data file could not be read
-
calc
@Deprecated public static java.util.Map<java.lang.String,java.lang.Object> calc(byte[] dataBytes, java.util.Collection<java.lang.String> algos) throws java.io.IOException
Deprecated.use SPI checksum selector instead- Throws:
java.io.IOException
-
toHexString
public static java.lang.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 benull- Returns:
- the hexadecimal representation of the input or
nullif the input wasnull
-
fromHexString
public static byte[] fromHexString(java.lang.String hexString)
Deprecated.Creates a byte array out of hexadecimal representation of the specified bytes. If input string isnull,nullis returned. Input value must have even length (due hex encoding = 2 chars one byte).- Parameters:
hexString- the hexString to convert to byte array, may benull- Returns:
- the byte array of the input or
nullif the input wasnull - Since:
- 1.8.0
-
-