other
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package UE00_Other;
|
package UE00_Other.duplicateFiles;
|
||||||
|
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package UE00_Other.hashVergleich;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class hashVergleich {
|
||||||
|
|
||||||
|
public static void main(String[] args) throws IOException {
|
||||||
|
Map<String, String> nas = loadHashes("src/UE00_Other/hashVergleich/hashes_nas.md5");
|
||||||
|
Map<String, String> samba = loadHashes("src/UE00_Other/hashVergleich/hashes_samba.md5");
|
||||||
|
for (String file : nas.keySet())
|
||||||
|
if (!samba.containsKey(file)) System.out.println(file + " fehlt im Ziel");
|
||||||
|
else if (!nas.get(file).equals(samba.get(file))) System.out.println(file + " ist unterschiedlich");
|
||||||
|
for (String file : samba.keySet())
|
||||||
|
if (!nas.containsKey(file)) System.out.println(file + " ist neu im Ziel, aber nicht in der Quelle");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Map<String, String> loadHashes(String filename) throws IOException {
|
||||||
|
Map<String, String> output = new HashMap<>();
|
||||||
|
List<String> lines = Files.readAllLines(Paths.get(filename));
|
||||||
|
for (String line : lines) {
|
||||||
|
if (line.trim().isEmpty()) continue;
|
||||||
|
String[] parts = line.trim().split("\\s+", 2);
|
||||||
|
if (parts.length == 2) {
|
||||||
|
String filenameOnly = Paths.get(parts[1].replaceFirst("^\\./", "")).getFileName().toString();
|
||||||
|
if (filenameOnly.contains("@SynoEAStream")) continue;
|
||||||
|
output.put(filenameOnly, parts[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user