final WildcardFileFilter matcher = new WildcardFileFilter(wildcard);
filter = new FileFilter() {
@Override
public boolean accept(File file) {
// match either the file or parent folder
boolean answer = matcher.accept(file);
if (!answer) {
File parentFile = file.getParentFile();
if (parentFile != null) {
answer = accept(parentFile);
}