I tend to find the FileTree
interface more useful than FileCollection
for filtering.
eg:
FileTree filtered = fileTree(dir).matching {
include "**/file1" // will include files in nested folders
include "file2", "file4" // files in root folder
}
Set<File> files = filtered.files
@see PatternFilterable