public abstract class MD5FileUtils
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
MD5_SUFFIX |
| Constructor | Description |
|---|---|
MD5FileUtils() |
| Modifier and Type | Method | Description |
|---|---|---|
static org.apache.hadoop.io.MD5Hash |
computeMd5ForFile(java.io.File dataFile) |
Read dataFile and compute its MD5 checksum.
|
static java.io.File |
getDigestFileForFile(java.io.File file) |
|
static org.apache.hadoop.io.MD5Hash |
readStoredMd5ForFile(java.io.File dataFile) |
Read the md5 checksum stored alongside the given data file.
|
static void |
renameMD5File(java.io.File oldDataFile,
java.io.File newDataFile) |
|
static void |
saveMD5File(java.io.File dataFile,
org.apache.hadoop.io.MD5Hash digest) |
Save the ".md5" file that lists the md5sum of another file.
|
static void |
verifySavedMD5(java.io.File dataFile,
org.apache.hadoop.io.MD5Hash expectedMD5) |
Verify that the previously saved md5 for the given file matches
expectedMd5.
|
public static final java.lang.String MD5_SUFFIX
public static void verifySavedMD5(java.io.File dataFile,
org.apache.hadoop.io.MD5Hash expectedMD5)
throws java.io.IOException
java.io.IOExceptionpublic static org.apache.hadoop.io.MD5Hash readStoredMd5ForFile(java.io.File dataFile)
throws java.io.IOException
dataFile - the file containing datajava.io.IOExceptionpublic static org.apache.hadoop.io.MD5Hash computeMd5ForFile(java.io.File dataFile)
throws java.io.IOException
java.io.IOExceptionpublic static void saveMD5File(java.io.File dataFile,
org.apache.hadoop.io.MD5Hash digest)
throws java.io.IOException
dataFile - the original file whose md5 was computeddigest - the computed digestjava.io.IOExceptionpublic static void renameMD5File(java.io.File oldDataFile,
java.io.File newDataFile)
throws java.io.IOException
java.io.IOExceptionpublic static java.io.File getDigestFileForFile(java.io.File file)
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.