File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
src/test/java/io/frictionlessdata/datapackage Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -668,8 +668,8 @@ public void testWriteWithConsumer() throws Exception{
668668 File fingerprints = new File (dir , "fingerprints.txt" );
669669 String content = String .join ("\n " , Files .readAllLines (fingerprints .toPath ()));
670670 String refContent =
671- "datapackage.json\t 653e78055470efedea58350d50f6aa603a20f81835770f4d50445f7b1262ca77 \n " +
672- "schema.json\t 44ffaa100fdfa343f3b517c67b8ccbceffab9cf94764b0214fdbe46dd992fce6 " ;
671+ "datapackage.json\t e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 \n " +
672+ "schema.json\t e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 " ;
673673 Assertions .assertEquals (refContent , content );
674674 }
675675
@@ -888,12 +888,15 @@ private static void fingerprintFiles(Path path) {
888888
889889 for (File f : path .toFile ().listFiles ()) {
890890 if (f .isFile ()) {
891- try (DigestInputStream dis = new DigestInputStream (Files .newInputStream (f .toPath ()), md )) {
891+ /* try (DigestInputStream dis = new DigestInputStream(Files.newInputStream(f.toPath()), md)) {
892892 while (true) {
893893 if (dis.read() == -1) break;
894894 }
895895 md = dis.getMessageDigest();
896- }
896+ }*/
897+ String content = String .join ("\n " , Files .readAllLines (f .toPath ()));
898+ content = content .replaceAll ("[\\ n\\ r]+" , "\n " );
899+ md .digest (content .getBytes ());
897900
898901 StringBuilder result = new StringBuilder ();
899902 for (byte b : md .digest ()) {
You can’t perform that action at this time.
0 commit comments