public abstract class MD5FileUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static org.slf4j.Logger |
LOG |
static String |
MD5_SUFFIX |
| 构造器和说明 |
|---|
MD5FileUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static MD5Hash |
computeAndSaveMd5ForFile(File dataFile) |
static MD5Hash |
computeMd5ForFile(File dataFile)
Read dataFile and compute its MD5 checksum.
|
static File |
getDigestFileForFile(File file) |
static MD5Hash |
readStoredMd5ForFile(File dataFile)
Read the md5 checksum stored alongside the given data file.
|
static void |
saveMD5File(File dataFile,
MD5Hash digest)
Save the ".md5" file that lists the md5sum of another file.
|
static void |
verifySavedMD5(File dataFile,
MD5Hash expectedMD5)
Verify that the previously saved md5 for the given file matches
expectedMd5.
|
public static void verifySavedMD5(File dataFile, MD5Hash expectedMD5) throws IOException
IOExceptionpublic static MD5Hash readStoredMd5ForFile(File dataFile) throws IOException
dataFile - the file containing dataIOExceptionpublic static MD5Hash computeMd5ForFile(File dataFile) throws IOException
IOExceptionpublic static void saveMD5File(File dataFile, MD5Hash digest) throws IOException
dataFile - the original file whose md5 was computeddigest - the computed digestIOExceptionCopyright © 2017–2023 The Apache Software Foundation. All rights reserved.