@Test public void testAcceptDirectory() { final RecursiveSearchFilter f = new RecursiveSearchFilter(new AttributedList<>(Arrays.<Path>asList( new Path("/d", EnumSet.of(Path.Type.directory)), new Path("/d/f", EnumSet.of(Path.Type.file))) )); assertTrue(f.accept(new Path("/d", EnumSet.of(Path.Type.directory)))); assertTrue(f.accept(new Path("/d/f", EnumSet.of(Path.Type.file)))); assertFalse(f.accept(new Path("/d/f2", EnumSet.of(Path.Type.file)))); assertFalse(f.accept(new Path("/a", EnumSet.of(Path.Type.file)))); }
@Override public boolean accept(final Path file) { if(list.find(new SimplePathPredicate(file)) != null) { return true; } for(Path f : list) { if(f.isChild(file)) { return true; } } return false; }
RecursiveSearchFilter extends NullFilter<Path> { @Override public boolean accept(final Path file) { if(list.find(new SimplePathPredicate(file)) != null) { return true; } for(Path f : list) { if(f.isChild(file)) { return true; } } return false; } }
RecursiveSearchFilter extends NullFilter<Path> { @Override public boolean accept(final Path file) { if(list.find(new SimplePathPredicate(file)) != null) { return true; } for(Path f : list) { if(f.isChild(file)) { return true; } } return false; } RecursiveSearchFilter(final AttributedList<Path> list); }
RecursiveSearchFilter extends NullFilter<Path> { @Override public boolean accept(final Path file) { if(list.find(new SimplePathPredicate(file)) != null) { return true; } for(Path f : list) { if(f.isChild(file)) { return true; } } return false; } RecursiveSearchFilter(final AttributedList<Path> list); @Override boolean accept(final Path file); }
RecursiveSearchFilter extends NullFilter<Path> { @Override public boolean accept(final Path file) { if(list.find(new SimplePathPredicate(file)) != null) { return true; } for(Path f : list) { if(f.isChild(file)) { return true; } } return false; } RecursiveSearchFilter(final AttributedList<Path> list); @Override boolean accept(final Path file);  }