@Test public void testNoCacheNotFound() throws Exception { final PathCache cache = new PathCache(1); final AttributedList<Path> list = new AttributedList<Path>(); cache.put(new Path("/g", EnumSet.of(Path.Type.directory)), list); final AtomicBoolean b = new AtomicBoolean(); final Find finder = new SwiftFindFeature(new SwiftMetadataFeature(new SwiftSession(new Host(new SwiftProtocol()), new DisabledX509TrustManager(), new DefaultX509KeyManager()) { @Override public Client getClient() { fail(); return null; } }) { @Override public Map<String, String> getMetadata(final Path file) { b.set(true); return Collections.emptyMap(); } }).withCache(cache); assertTrue(finder.find(new Path("/g/" + UUID.randomUUID().toString(), EnumSet.of(Path.Type.file)))); assertTrue(b.get()); }
@Override public boolean find(final Path file) throws BackgroundException { if(file.isRoot()) { return true; } try { feature.getMetadata(file); return true; } catch(NotfoundException e) { return false; } }
SwiftFindFeature implements Find { @Override public boolean find(final Path file) throws BackgroundException { if(file.isRoot()) { return true; } try { feature.getMetadata(file); return true; } catch(NotfoundException e) { return false; } } }
SwiftFindFeature implements Find { @Override public boolean find(final Path file) throws BackgroundException { if(file.isRoot()) { return true; } try { feature.getMetadata(file); return true; } catch(NotfoundException e) { return false; } } SwiftFindFeature(final SwiftSession session);  SwiftFindFeature(final Headers feature); }
SwiftFindFeature implements Find { @Override public boolean find(final Path file) throws BackgroundException { if(file.isRoot()) { return true; } try { feature.getMetadata(file); return true; } catch(NotfoundException e) { return false; } } SwiftFindFeature(final SwiftSession session);  SwiftFindFeature(final Headers feature); @Override boolean find(final Path file); }
SwiftFindFeature implements Find { @Override public boolean find(final Path file) throws BackgroundException { if(file.isRoot()) { return true; } try { feature.getMetadata(file); return true; } catch(NotfoundException e) { return false; } } SwiftFindFeature(final SwiftSession session);  SwiftFindFeature(final Headers feature); @Override boolean find(final Path file);  }