Hey,
ich würde gerne List<List<String>> nutzen und zwar wie folgt:
Ich durchsuche eine Verzeichnis (path) nach Dateien (files).
Sobald eine Datei (files) gefunden wird soll diese in zweiten List-Element gespeichert werden und im ersten Element, das Unterverzeichnis (Path).
C:
-Programme
--a.log
--b.log
--c.log
-System
--a.log
--b.log
-a.log
-b.log
Als List<List<String>> dann:
c
rogramme | a.log,b.log,c.log
c:System | a.log,b.log
c: | a.log,b.log
Mein Code bisher
ich würde gerne List<List<String>> nutzen und zwar wie folgt:
Ich durchsuche eine Verzeichnis (path) nach Dateien (files).
Sobald eine Datei (files) gefunden wird soll diese in zweiten List-Element gespeichert werden und im ersten Element, das Unterverzeichnis (Path).
C:
-Programme
--a.log
--b.log
--c.log
-System
--a.log
--b.log
-a.log
-b.log
Als List<List<String>> dann:
c
c:System | a.log,b.log
c: | a.log,b.log
Mein Code bisher
Java:
private static List<List<String>> AllPic;
private static List<List<String>> AllMov;
public static void find(File path) {
if(path.exists() == true) {
File[] files = path.listFiles();
if(files != null){
for(int i1 = 0; files.length <= i1; i1++) {
loops:
if(files[i1].isDirectory()) findPicMov(files[i1]);
else if(files[i1].isFile()) {
String name = files[i1].getName();
for(int pic = 0; Menu.getterPicFormat().length <= pic; pic++) {
if (name.endsWith("." + Menu.getterAllPictureFormat()[pic])==true){
AllPic.add(path).add(files[i1]);
break loops;
}
}
for(int movi = 0; Menu.getterMoviFormat().length <= movi; movi++) {
...
}
}
}
}
}
}
}
Zuletzt bearbeitet: