Search in sources :

Example 21 with MD5Hash

use of org.apache.hadoop.io.MD5Hash in project hadoop by apache.

the class TestMD5FileUtils method testComputeMd5ForFile.

@Test
public void testComputeMd5ForFile() throws Exception {
    MD5Hash computedDigest = MD5FileUtils.computeMd5ForFile(TEST_FILE);
    assertEquals(TEST_MD5, computedDigest);
}
Also used : MD5Hash(org.apache.hadoop.io.MD5Hash) Test(org.junit.Test)

Aggregations

MD5Hash (org.apache.hadoop.io.MD5Hash)21 IOException (java.io.IOException)11 File (java.io.File)8 MessageDigest (java.security.MessageDigest)5 NameNodeFile (org.apache.hadoop.hdfs.server.namenode.NNStorage.NameNodeFile)5 DigestInputStream (java.security.DigestInputStream)3 FileInputStream (java.io.FileInputStream)2 FileOutputStream (java.io.FileOutputStream)2 InputStream (java.io.InputStream)2 CountingOutputStream (com.google.common.io.CountingOutputStream)1 BufferedOutputStream (java.io.BufferedOutputStream)1 InputStreamReader (java.io.InputStreamReader)1 HttpURLConnection (java.net.HttpURLConnection)1 URI (java.net.URI)1 DigestOutputStream (java.security.DigestOutputStream)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Matcher (java.util.regex.Matcher)1 ServletContext (javax.servlet.ServletContext)1