@Test public void testWindowsPathMatching() { final Set<String> dataFileIncludes = ImmutableSet.of("**\\*.xml"); final Set<String> dataFileExcludes = ImmutableSet.copyOf(DirectoryScanner.getDefaultExcludes()); final AntPatternFileFilter antPatternFileFilter = new AntPatternFileFilter(false, true, dataFileIncludes, dataFileExcludes); final boolean accepted = antPatternFileFilter.accept( null, "C:\\up\\uPortal_trunk\\uportal-war\\src\\main\\data\\default_entities\\portlet\\ImportExportPortlet.portlet.xml"); assertTrue(accepted); }
@Override public boolean accept(File pathname) { if (ignoreHidden && pathname.isHidden()) { return false; } final String path; try { path = pathname.getCanonicalPath(); } catch (IOException e) { throw new RuntimeException("Could not determine canonical path of: " + pathname, e); } return accept(pathname, path); }
AntPatternFileFilter implements FileFilter { @Override public boolean accept(File pathname) { if (ignoreHidden && pathname.isHidden()) { return false; } final String path; try { path = pathname.getCanonicalPath(); } catch (IOException e) { throw new RuntimeException("Could not determine canonical path of: " + pathname, e); } return accept(pathname, path); } }
AntPatternFileFilter implements FileFilter { @Override public boolean accept(File pathname) { if (ignoreHidden && pathname.isHidden()) { return false; } final String path; try { path = pathname.getCanonicalPath(); } catch (IOException e) { throw new RuntimeException("Could not determine canonical path of: " + pathname, e); } return accept(pathname, path); } AntPatternFileFilter(
            boolean acceptDirectories,
            boolean ignoreHidden,
            String include,
            Collection<String> excludes);  AntPatternFileFilter(
            boolean acceptDirectories,
            boolean ignoreHidden,
            Collection<String> includes,
            Collection<String> excludes); }
AntPatternFileFilter implements FileFilter { @Override public boolean accept(File pathname) { if (ignoreHidden && pathname.isHidden()) { return false; } final String path; try { path = pathname.getCanonicalPath(); } catch (IOException e) { throw new RuntimeException("Could not determine canonical path of: " + pathname, e); } return accept(pathname, path); } AntPatternFileFilter(
            boolean acceptDirectories,
            boolean ignoreHidden,
            String include,
            Collection<String> excludes);  AntPatternFileFilter(
            boolean acceptDirectories,
            boolean ignoreHidden,
            Collection<String> includes,
            Collection<String> excludes); @Override boolean accept(File pathname); }
AntPatternFileFilter implements FileFilter { @Override public boolean accept(File pathname) { if (ignoreHidden && pathname.isHidden()) { return false; } final String path; try { path = pathname.getCanonicalPath(); } catch (IOException e) { throw new RuntimeException("Could not determine canonical path of: " + pathname, e); } return accept(pathname, path); } AntPatternFileFilter(
            boolean acceptDirectories,
            boolean ignoreHidden,
            String include,
            Collection<String> excludes);  AntPatternFileFilter(
            boolean acceptDirectories,
            boolean ignoreHidden,
            Collection<String> includes,
            Collection<String> excludes); @Override boolean accept(File pathname);  }