other
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package UE00_Other;
|
||||
package UE00_Other.duplicateFiles;
|
||||
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
36
src/UE00_Other/hashVergleich/hashVergleich.java
Normal file
36
src/UE00_Other/hashVergleich/hashVergleich.java
Normal file
@@ -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;
|
||||
}
|
||||
}
|
||||
280380
src/UE00_Other/hashVergleich/hashes_nas.md5
Normal file
280380
src/UE00_Other/hashVergleich/hashes_nas.md5
Normal file
File diff suppressed because it is too large
Load Diff
90916
src/UE00_Other/hashVergleich/hashes_nas_music.md5
Normal file
90916
src/UE00_Other/hashVergleich/hashes_nas_music.md5
Normal file
File diff suppressed because it is too large
Load Diff
56158
src/UE00_Other/hashVergleich/hashes_samba.md5
Normal file
56158
src/UE00_Other/hashVergleich/hashes_samba.md5
Normal file
File diff suppressed because it is too large
Load Diff
44795
src/UE00_Other/hashVergleich/hashes_samba_music.md5
Normal file
44795
src/UE00_Other/hashVergleich/hashes_samba_music.md5
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user