@Test public void testAccept() { final Pattern pattern = Pattern.compile(".*~\\..*|\\.DS_Store|\\.svn|CVS"); assertFalse(new UploadRegexFilter(pattern).accept(new NullLocal(".DS_Store"))); assertTrue(new UploadRegexFilter(pattern).accept(new NullLocal("f"))); assertTrue(new UploadRegexFilter(Pattern.compile("")).accept(new NullLocal("f"))); assertTrue(new UploadRegexFilter(Pattern.compile("")).accept(new NullLocal(".DS_Store"))); }
@Override public boolean accept(final Local file) { if(pattern.matcher(file.getName()).matches()) { if(log.isDebugEnabled()) { log.debug(String.format("Skip %s excluded with regex", file)); } return false; } return true; }
UploadRegexFilter implements Filter<Local> { @Override public boolean accept(final Local file) { if(pattern.matcher(file.getName()).matches()) { if(log.isDebugEnabled()) { log.debug(String.format("Skip %s excluded with regex", file)); } return false; } return true; } }
UploadRegexFilter implements Filter<Local> { @Override public boolean accept(final Local file) { if(pattern.matcher(file.getName()).matches()) { if(log.isDebugEnabled()) { log.debug(String.format("Skip %s excluded with regex", file)); } return false; } return true; } UploadRegexFilter();  UploadRegexFilter(final Pattern pattern); }
UploadRegexFilter implements Filter<Local> { @Override public boolean accept(final Local file) { if(pattern.matcher(file.getName()).matches()) { if(log.isDebugEnabled()) { log.debug(String.format("Skip %s excluded with regex", file)); } return false; } return true; } UploadRegexFilter();  UploadRegexFilter(final Pattern pattern); @Override boolean accept(final Local file); @Override Pattern toPattern(); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode(); }
UploadRegexFilter implements Filter<Local> { @Override public boolean accept(final Local file) { if(pattern.matcher(file.getName()).matches()) { if(log.isDebugEnabled()) { log.debug(String.format("Skip %s excluded with regex", file)); } return false; } return true; } UploadRegexFilter();  UploadRegexFilter(final Pattern pattern); @Override boolean accept(final Local file); @Override Pattern toPattern(); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode();  }