@Test public void testFind() throws Exception { final AtomicInteger count = new AtomicInteger(); final DefaultFindFeature feature = new DefaultFindFeature(new NullSession(new Host(new TestProtocol())) { @Override public AttributedList<Path> list(Path file, ListProgressListener listener) { count.incrementAndGet(); return AttributedList.emptyList(); } }); assertFalse(feature.find(new Path("/t", EnumSet.of(Path.Type.directory)))); assertEquals(1, count.get()); assertFalse(feature.find(new Path("/t", EnumSet.of(Path.Type.directory)))); assertEquals(2, count.get()); }
@Override public boolean find(final Path file) throws BackgroundException { if(file.isRoot()) { return true; } try { final Path found = this.search(file); return found != null; } catch(NotfoundException e) { return false; } }
DefaultFindFeature extends ListFilteringFeature implements Find { @Override public boolean find(final Path file) throws BackgroundException { if(file.isRoot()) { return true; } try { final Path found = this.search(file); return found != null; } catch(NotfoundException e) { return false; } } }
DefaultFindFeature extends ListFilteringFeature implements Find { @Override public boolean find(final Path file) throws BackgroundException { if(file.isRoot()) { return true; } try { final Path found = this.search(file); return found != null; } catch(NotfoundException e) { return false; } } DefaultFindFeature(final Session<?> session); }
DefaultFindFeature extends ListFilteringFeature implements Find { @Override public boolean find(final Path file) throws BackgroundException { if(file.isRoot()) { return true; } try { final Path found = this.search(file); return found != null; } catch(NotfoundException e) { return false; } } DefaultFindFeature(final Session<?> session); @Override boolean find(final Path file); @Override DefaultFindFeature withCache(final Cache<Path> cache); }
DefaultFindFeature extends ListFilteringFeature implements Find { @Override public boolean find(final Path file) throws BackgroundException { if(file.isRoot()) { return true; } try { final Path found = this.search(file); return found != null; } catch(NotfoundException e) { return false; } } DefaultFindFeature(final Session<?> session); @Override boolean find(final Path file); @Override DefaultFindFeature withCache(final Cache<Path> cache);  }