public boolean fitsTemplate(String path, String template) { return FileSystems.getDefault() .getPathMatcher("glob:" + template) .matches(Paths.get(path)); }