}
};
}
public static DirectoryStream.Filter<Path> buildRegexFilter(String pattern) {
final PathMatcher pathMatcher = getPathMatcher("regex:"+pattern);
return new DirectoryStream.Filter<Path>() {
@Override
public boolean accept(Path entry) throws IOException {
return pathMatcher.matches(entry);
}
};
}