Skip to content

Commit 1932b6f

Browse files
committed
Updated file reader to read resource file.
1 parent 34ffa26 commit 1932b6f

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

‎src/main/java/com/eprogrammerz/examples/general/hashGenerator/HashGenerator.java‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import java.io.*;
1212
import java.security.MessageDigest;
1313
import java.security.NoSuchAlgorithmException;
14-
import java.util.Arrays;
1514
import java.util.Formatter;
1615

1716
import static org.junit.Assert.assertEquals;
@@ -23,9 +22,9 @@ public class HashGenerator {
2322

2423
@Test
2524
public void testHashGenerators() throws IOException, NoSuchAlgorithmException {
26-
File input = new File("/Users/yrai/Downloads/E.tif");
27-
28-
// String defHashValue = getHashWithByteBuffer(input);
25+
// File input = new File("/Users/yrai/Downloads/E.tif");
26+
ClassLoader classLoader = getClass().getClassLoader();
27+
File input = new File(classLoader.getResource("random-pic.jpg").getFile());
2928

3029
long startTime = System.currentTimeMillis();
3130
String handBufHashValue = getImageHashValue(input);

‎src/main/resources/random-pic.jpg‎

41.8 KB
Loading

0 commit comments

Comments
 (0)