I'm just learning Apache Commons VFS. I'd like to search for a file in a certain directory, but I don't know the exact name of the file. I do, however, know a part of the name.
To search for a file, I think I can do something like this:
FileSystemManager manager = VFS.getManager();
FileObject file = manager.resolveFile(directory + "/" + filename);
if (file.exists()) {
System.out.println("File found");
} else {
System.out.println("File not found");
}
where "directory" is a String of the directory I want to look in, and "filename" is the exact filename of the file I want to look for. That should print out whether or not the file is there.
I'm wondering if I can do something similar when I don't know the exact name of the file, but I do know part of it. For example, if I know the filename ends in "foo.txt", can I do some sort of wildcard search for "*foo.txt"?