It looks like these are the ways to get a list of files from Java (from here: Using File.listFiles with FileNameExtensionFilter)
Option 1:
File dir = new File("/users/blah/dirname");
File[] files = dir.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
return name.toLowerCase().endsWith(".txt");
}
});
Java 8 Option:
pdfTestDir.listFiles((dir, name) -> name.toLowerCase().endsWith(".txt"));
Question:
Is there really not a way to use a typical file wildcard expression like "./foo/**/admin/*.txt"? Something like:
File dir = new File("/users/foo/bar");
dir.listFiles("./foo/**/admin/*.txt");
or maybe something like
SomeUtil.listFiles(file, "./foo/**/admin/*.txt");
Similar to:
This question is similar to this Stackoverflow post, however this post doesn't really address the question of the recursive case (e.g. "./../*.txt").
How to use a Wildcard in Java filepath
Also similar to this How to find files that match a wildcard string in Java? (which looks more promising, but also does not ask/answer the question why isn't this part of the Java core implementation).