/* extract relative pattern */
Path p = new Path(fileNamePattern);
pattern = new FileNamePattern(p.lastSegment(), context);
}
final String patternRegex = pattern.toRegex();
File[] files = dir.listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
return name.matches(patternRegex);
}