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