I'm using Apache Commons VFS2.0 to access files both in a local file system and a remote file system. I'm trying to find a way to filter all the descendent files in any depth with FileType=File
and has a given filePrefix with the file name. I was able to do it for the same case except for file prefix, but for file extension, as follows.
FileSelector fileSelector = new FileExtensionSelector("extensions...");
directory.findFiles(fileSelector);
In this way, I was able to fetch all the files(no folders) in any depth with the given extension. I have tried the below approach but it only works for matching files with depth=1.
FileFilterSelector prefixFileSelector = new FileFilterSelector(new PrefixFileFilter("Prefix"));
directory.findFiles(prefixFileSelector);
Appreciate if anyone can give a suggestion.