Can we please introduce a simpler file search method than the existing ones that are using filters?
Currently I'm using the ant lib's DirectoryScanner for that purpose. However, ant comes with quite a few dependencies, introducing unnecessary overhead and bloat.
// select all sub directories (final slash) of cwd
File f = FileUtils.glob("**/");
// select first sub dir, null if there is none
File f = FileUtils.globFirst("**/");
// exception if there is none
File f = FileUtils.globFirstE("**/");
// select exactly one sub dir, return null if there are more or less
File f = FileUtils.globOne("**/");
// select exactly one sub dir, throw exception if there are more or less
File f = FileUtils.globOneE("**/");
// two parameter version allows to start recursive search in specified dir
File f = FileUtils.globOneE(new File("."), "**/");
"**" match anything including file separators, "*" match anything excluding file separators, a final "/" indicates directory matching, a missing final slash indicates file matching. The function always traverses the entire directory hierarchy, starting at cwd by default (not counting optimizations). The search pattern is standardized, ie. "/" on all platforms, ie. "/" is not the platform file separator.