Java NIO’s PathMatcher provides FileSystem.getPathMatcher(String syntaxAndPattern):
PathMatcher matcher = FileSystems.getDefault().getPathMatcher("glob:*.java");
Path filename = ...;
if (matcher.matches(filename)) {
System.out.println(filename);
}
See the Finding Files tutorial for details.