@Override
    public boolean accept(final Path file) {
        if(!super.accept(file)) {
            return false;
        }
        if(pattern.matcher(file.getName()).matches()) {
            if(log.isDebugEnabled()) {
                log.debug(String.format("Skip %s excluded with regex", file.getAbsolute()));
            }
            return false;
        }
        return true;
    }
@Test
    public void testAccept() {
        final Pattern pattern = Pattern.compile(".*~\\..*|\\.DS_Store|\\.svn|CVS|RCS|SCCS|\\.git|\\.bzr|\\.bzrignore|\\.bzrtags|\\.hg|\\.hgignore|\\.hgtags|_darcs|\\.file-segments");
        assertFalse(new DownloadRegexFilter(pattern).accept(new Path(".DS_Store", EnumSet.of(Path.Type.file))));
        assertTrue(new DownloadRegexFilter(pattern).accept(new Path("f", EnumSet.of(Path.Type.file))));
        assertTrue(new DownloadRegexFilter(Pattern.compile("")).accept(new Path("f", EnumSet.of(Path.Type.file))));
        assertTrue(new DownloadRegexFilter(Pattern.compile("")).accept(new Path("f", EnumSet.of(Path.Type.file))));
    }