package javaforum.thor_der_gott;
import java.io.File;
import java.io.FileFilter;
public class Durchsuchen {
private static final File PATH_1 = new File("C:/");
private static final File PATH_2 = new File("D:/");
private static final File PATH_3 = new File("E:/");
private static final String SEACH_FILECONTENT = "boot.ini";
public static void main(String[] args) {
File[] paths = new File[] {
PATH_1, PATH_2, PATH_3
};
for(File f:paths) {
search(f, new FileFilter() {
public boolean accept(File pathname) {
return(pathname.getName().contains(SEACH_FILECONTENT) || pathname.isDirectory());
}
});
}
}
private static void search(File f, FileFilter fileFilter) {
File[] content = f.listFiles(fileFilter);
for(File contentFile:content) {
if(contentFile.isDirectory()) {
search(contentFile, fileFilter);
} else {
System.out.println(contentFile.getAbsolutePath());
}
}
}
}