@Test public void testDeleteFolderRoomWithContent() throws Exception { final SDSNodeIdProvider nodeid = new SDSNodeIdProvider(session).withCache(cache); final Path room = new SDSDirectoryFeature(session, nodeid).mkdir(new Path( new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume, Path.Type.triplecrypt)), null, new TransferStatus()); final Path folder = new SDSDirectoryFeature(session, nodeid).mkdir(new Path(room, new AlphanumericRandomStringService().random().toLowerCase(), EnumSet.of(Path.Type.directory)), null, new TransferStatus()); assertTrue(new DefaultFindFeature(session).find(folder)); final Path file = new Path(folder, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)); new SDSTouchFeature(session, nodeid).touch(file, new TransferStatus()); assertTrue(new DefaultFindFeature(session).find(file)); new SDSDeleteFeature(session, nodeid).delete(Collections.singletonList(folder), new DisabledLoginCallback(), new Delete.DisabledCallback()); assertFalse(new DefaultFindFeature(session).find(folder)); new SDSDeleteFeature(session, nodeid).delete(Collections.singletonList(room), new DisabledLoginCallback(), new Delete.DisabledCallback()); assertFalse(new DefaultFindFeature(session).find(room)); }
@Override public void delete(final Map<Path, TransferStatus> files, final PasswordCallback prompt, final Callback callback) throws BackgroundException { for(Path file : files.keySet()) { callback.delete(file); try { new NodesApi(session.getClient()).removeNode( Long.parseLong(nodeid.getFileid(file, new DisabledListProgressListener())), StringUtils.EMPTY); } catch(ApiException e) { throw new SDSExceptionMappingService().map("Cannot delete {0}", e, file); } } }
SDSDeleteFeature implements Delete { @Override public void delete(final Map<Path, TransferStatus> files, final PasswordCallback prompt, final Callback callback) throws BackgroundException { for(Path file : files.keySet()) { callback.delete(file); try { new NodesApi(session.getClient()).removeNode( Long.parseLong(nodeid.getFileid(file, new DisabledListProgressListener())), StringUtils.EMPTY); } catch(ApiException e) { throw new SDSExceptionMappingService().map("Cannot delete {0}", e, file); } } } }
SDSDeleteFeature implements Delete { @Override public void delete(final Map<Path, TransferStatus> files, final PasswordCallback prompt, final Callback callback) throws BackgroundException { for(Path file : files.keySet()) { callback.delete(file); try { new NodesApi(session.getClient()).removeNode( Long.parseLong(nodeid.getFileid(file, new DisabledListProgressListener())), StringUtils.EMPTY); } catch(ApiException e) { throw new SDSExceptionMappingService().map("Cannot delete {0}", e, file); } } } SDSDeleteFeature(final SDSSession session, final SDSNodeIdProvider nodeid); }
SDSDeleteFeature implements Delete { @Override public void delete(final Map<Path, TransferStatus> files, final PasswordCallback prompt, final Callback callback) throws BackgroundException { for(Path file : files.keySet()) { callback.delete(file); try { new NodesApi(session.getClient()).removeNode( Long.parseLong(nodeid.getFileid(file, new DisabledListProgressListener())), StringUtils.EMPTY); } catch(ApiException e) { throw new SDSExceptionMappingService().map("Cannot delete {0}", e, file); } } } SDSDeleteFeature(final SDSSession session, final SDSNodeIdProvider nodeid); @Override void delete(final Map<Path, TransferStatus> files, final PasswordCallback prompt, final Callback callback); @Override boolean isSupported(final Path file); @Override boolean isRecursive(); }
SDSDeleteFeature implements Delete { @Override public void delete(final Map<Path, TransferStatus> files, final PasswordCallback prompt, final Callback callback) throws BackgroundException { for(Path file : files.keySet()) { callback.delete(file); try { new NodesApi(session.getClient()).removeNode( Long.parseLong(nodeid.getFileid(file, new DisabledListProgressListener())), StringUtils.EMPTY); } catch(ApiException e) { throw new SDSExceptionMappingService().map("Cannot delete {0}", e, file); } } } SDSDeleteFeature(final SDSSession session, final SDSNodeIdProvider nodeid); @Override void delete(final Map<Path, TransferStatus> files, final PasswordCallback prompt, final Callback callback); @Override boolean isSupported(final Path file); @Override boolean isRecursive();  }