Class ChecksumValidator
java.lang.Object
io.github.rajendarreddyj.tomcat.download.ChecksumValidator
Validates file integrity using SHA-512 checksums.
- Since:
- 1.0.0
- Author:
- rajendarreddyj
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ChecksumValidator
public ChecksumValidator()
-
-
Method Details
-
validate
Validates file checksum against remote SHA-512 file.- Parameters:
file- The file to validatechecksumUrl- URL to the .sha512 checksum file- Returns:
- true if checksum matches, false otherwise
- Throws:
IOException- if checksum cannot be read or calculated
-
calculateChecksum
Calculates SHA-512 checksum of a file.- Parameters:
file- the file to calculate checksum for- Returns:
- the hex-encoded checksum
- Throws:
IOException- if file cannot be read or algorithm unavailable
-