1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
public boolean testSearcher(File source) {
boolean pslSearcher = false; //declare the returned boolean
String modele = "test*";
File[] dirContent = source.listFiles(); //browse the source folder
File f = null;
for (int i=0; i<dirContent.length; i++) {
f = dirContent[i];
String r = f.getName();
if (Pattern.matches(modele, f.getName())) {
folderContent = f.getParentFile();
return true;
}else if (f.isDirectory()) {
testSearcher= testSearcher(f);
if(testSearcher) return true;
}
}
return testSearcher;
}
} |
Partager