@Test public void testFindCommonPrefix() throws Exception { final Path container = new Path("test-us-east-1-cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume)); assertTrue(new S3FindFeature(session).find(container)); final String prefix = new AlphanumericRandomStringService().random(); final Path test = new S3TouchFeature(session).touch( new Path(new Path(container, prefix, EnumSet.of(Path.Type.directory)), new AsciiRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus()); assertTrue(new S3FindFeature(session).find(test)); assertTrue(new S3FindFeature(session).find(new Path(container, prefix, EnumSet.of(Path.Type.directory, Path.Type.placeholder)))); new S3DefaultDeleteFeature(session).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback()); }
@Override public boolean find(final Path file) throws BackgroundException { if(file.isRoot()) { return true; } try { if(file.isFile() || file.isPlaceholder()) { attributes.find(file); return true; } else { try { new S3ObjectListService(session).list(file, new DisabledListProgressListener(), containerService.getKey(file)); return true; } catch(NotfoundException e) { throw e; } } } catch(NotfoundException e) { return false; } catch(AccessDeniedException e) { return true; } }
S3FindFeature implements Find { @Override public boolean find(final Path file) throws BackgroundException { if(file.isRoot()) { return true; } try { if(file.isFile() || file.isPlaceholder()) { attributes.find(file); return true; } else { try { new S3ObjectListService(session).list(file, new DisabledListProgressListener(), containerService.getKey(file)); return true; } catch(NotfoundException e) { throw e; } } } catch(NotfoundException e) { return false; } catch(AccessDeniedException e) { return true; } } }
S3FindFeature implements Find { @Override public boolean find(final Path file) throws BackgroundException { if(file.isRoot()) { return true; } try { if(file.isFile() || file.isPlaceholder()) { attributes.find(file); return true; } else { try { new S3ObjectListService(session).list(file, new DisabledListProgressListener(), containerService.getKey(file)); return true; } catch(NotfoundException e) { throw e; } } } catch(NotfoundException e) { return false; } catch(AccessDeniedException e) { return true; } } S3FindFeature(final S3Session session); }
S3FindFeature implements Find { @Override public boolean find(final Path file) throws BackgroundException { if(file.isRoot()) { return true; } try { if(file.isFile() || file.isPlaceholder()) { attributes.find(file); return true; } else { try { new S3ObjectListService(session).list(file, new DisabledListProgressListener(), containerService.getKey(file)); return true; } catch(NotfoundException e) { throw e; } } } catch(NotfoundException e) { return false; } catch(AccessDeniedException e) { return true; } } S3FindFeature(final S3Session session); @Override boolean find(final Path file); @Override Find withCache(final Cache<Path> cache); }
S3FindFeature implements Find { @Override public boolean find(final Path file) throws BackgroundException { if(file.isRoot()) { return true; } try { if(file.isFile() || file.isPlaceholder()) { attributes.find(file); return true; } else { try { new S3ObjectListService(session).list(file, new DisabledListProgressListener(), containerService.getKey(file)); return true; } catch(NotfoundException e) { throw e; } } } catch(NotfoundException e) { return false; } catch(AccessDeniedException e) { return true; } } S3FindFeature(final S3Session session); @Override boolean find(final Path file); @Override Find withCache(final Cache<Path> cache);  }