ch.cyberduck.core.features.Delete.delete()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(8.9k)|赞(0)|评价(0)|浏览(248)

本文整理了Java中ch.cyberduck.core.features.Delete.delete()方法的一些代码示例,展示了Delete.delete()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Delete.delete()方法的具体详情如下:
包路径:ch.cyberduck.core.features.Delete
类名称:Delete
方法名:delete

Delete.delete介绍

暂无

代码示例

代码示例来源:origin: iterate-ch/cyberduck

  1. @Override
  2. public void delete(final List<Path> files, final PasswordCallback prompt, final Callback callback) throws BackgroundException {
  3. final Map<Vault, List<Path>> vaults = new HashMap<>();
  4. for(Path file : files) {
  5. final Vault vault = registry.find(session, file);
  6. final List<Path> sorted;
  7. if(vaults.containsKey(vault)) {
  8. sorted = vaults.get(vault);
  9. }
  10. else {
  11. sorted = new ArrayList<>();
  12. }
  13. sorted.add(file);
  14. vaults.put(vault, sorted);
  15. }
  16. for(Map.Entry<Vault, List<Path>> entry : vaults.entrySet()) {
  17. final Vault vault = entry.getKey();
  18. final Delete feature = vault.getFeature(session, Delete.class, proxy);
  19. feature.delete(entry.getValue(), prompt, callback);
  20. }
  21. }

代码示例来源:origin: iterate-ch/cyberduck

  1. @Override
  2. public Path move(final Path source, final Path target, final TransferStatus status, final Delete.Callback delete, final ConnectionCallback callback) throws BackgroundException {
  3. final Vault vault = registry.find(session, source);
  4. if(vault.equals(registry.find(session, target, false))) {
  5. if(log.isDebugEnabled()) {
  6. log.debug(String.format("Move %s to %s inside vault %s", source, target, vault));
  7. }
  8. // Move files inside vault
  9. return vault.getFeature(session, Move.class, proxy).move(source, target, status, delete, callback);
  10. }
  11. else {
  12. // Moving files from or into vault requires to pass through encryption features using copy operation
  13. final Path copy = session.getFeature(Copy.class).withTarget(destination).copy(source, target, status, callback);
  14. // Delete source file after copy is complete
  15. session.getFeature(Delete.class).delete(Collections.singletonList(source), callback, delete);
  16. return copy;
  17. }
  18. }

代码示例来源:origin: iterate-ch/cyberduck

  1. @Override
  2. public Path move(final Path file, final Path renamed, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException {
  3. final Path copy = new AzureCopyFeature(session, context).copy(file, renamed, new TransferStatus().length(file.attributes().getSize()), connectionCallback);
  4. delete.delete(Collections.singletonList(file), connectionCallback, callback);
  5. return copy;
  6. }

代码示例来源:origin: iterate-ch/cyberduck

  1. @Override
  2. public Path move(final Path file, final Path renamed, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException {
  3. final Path copy = new SwiftCopyFeature(session, regionService).copy(file, renamed, new TransferStatus().length(file.attributes().getSize()), connectionCallback);
  4. delete.delete(Collections.singletonList(file), connectionCallback, callback);
  5. return copy;
  6. }

代码示例来源:origin: iterate-ch/cyberduck

  1. @Override
  2. public List<Path> run(final Session<?> session) throws BackgroundException {
  3. final Delete delete = session.getFeature(Delete.class);
  4. final ListService list = session.getFeature(ListService.class);
  5. final List<Path> recursive = new ArrayList<Path>();
  6. for(Path file : files) {
  7. if(this.isCanceled()) {
  8. throw new ConnectionCanceledException();
  9. }
  10. recursive.addAll(this.compile(session.getHost(), delete, list, new WorkerListProgressListener(this, listener), file));
  11. }
  12. delete.delete(recursive, prompt, new Delete.Callback() {
  13. @Override
  14. public void delete(final Path file) {
  15. listener.message(MessageFormat.format(LocaleFactory.localizedString("Deleting {0}", "Status"),
  16. file.getName()));
  17. }
  18. });
  19. return recursive;
  20. }

代码示例来源:origin: iterate-ch/cyberduck

  1. session.getFeature(Delete.class).delete(Collections.singletonList(r.getKey()), callback, new Delete.DisabledCallback());

代码示例来源:origin: iterate-ch/cyberduck

  1. if(status.isExists()) {
  2. log.warn(String.format("Delete existing file %s", file));
  3. delete.delete(Collections.singletonList(file), callback, new Delete.DisabledCallback());

代码示例来源:origin: iterate-ch/cyberduck

  1. @Override
  2. public Path move(final Path source, final Path target, final TransferStatus status, final Delete.Callback callback,
  3. final ConnectionCallback connectionCallback) throws BackgroundException {
  4. if(containerService.isContainer(source)) {
  5. if(new SimplePathPredicate(source.getParent()).test(target.getParent())) {
  6. // Rename only
  7. return proxy.move(source, target, status, callback, connectionCallback);
  8. }
  9. }
  10. if(nodeid.isEncrypted(source) ^ nodeid.isEncrypted(target)) {
  11. // Moving into or from an encrypted room
  12. final Copy copy = session.getFeature(Copy.class);
  13. if(log.isDebugEnabled()) {
  14. log.debug(String.format("Move %s to %s using copy feature %s", source, target, copy));
  15. }
  16. final Path c = copy.copy(source, target, status, connectionCallback);
  17. // Delete source file after copy is complete
  18. final Delete delete = session.getFeature(Delete.class);
  19. if(delete.isSupported(source)) {
  20. delete.delete(Collections.singletonList(source), connectionCallback, callback);
  21. }
  22. return c;
  23. }
  24. else {
  25. return proxy.move(source, target, status, callback, connectionCallback);
  26. }
  27. }

代码示例来源:origin: iterate-ch/cyberduck

  1. proxy.delete(encrypted, prompt, callback);
  2. proxy.delete(metadata, prompt, callback);

代码示例来源:origin: iterate-ch/cyberduck

  1. @Override
  2. public Path move(final Path file, final Path renamed, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException {
  3. try {
  4. final IRODSFileSystemAO fs = session.getClient();
  5. final IRODSFile s = fs.getIRODSFileFactory().instanceIRODSFile(file.getAbsolute());
  6. if(!s.exists()) {
  7. throw new NotfoundException(String.format("%s doesn't exist", file.getAbsolute()));
  8. }
  9. if(status.isExists()) {
  10. delete.delete(Collections.singletonList(renamed), connectionCallback, callback);
  11. }
  12. final IRODSFile d = fs.getIRODSFileFactory().instanceIRODSFile(renamed.getAbsolute());
  13. s.renameTo(d);
  14. return renamed;
  15. }
  16. catch(JargonException e) {
  17. throw new IRODSExceptionMappingService().map("Cannot rename {0}", e, file);
  18. }
  19. }

代码示例来源:origin: iterate-ch/cyberduck

  1. delete.delete(Collections.singletonList(copy), connectionCallback, callback);
  2. try {
  3. final BaseVersionOrDeleteMarker markerObject = marker.getItems()[0];
  4. copy.attributes().withVersionId(markerObject.getVersionId()).setCustom(Collections.singletonMap(KEY_DELETE_MARKER, Boolean.TRUE.toString()));
  5. delete.delete(Collections.singletonList(source), connectionCallback, callback);
  6. copy = new S3ThresholdCopyFeature(session, accessControlListFeature).copy(source, renamed, status.length(source.attributes().getSize()), connectionCallback);
  7. delete.delete(Collections.singletonList(new Path(source).withAttributes(new PathAttributes(source.attributes()).withVersionId(null))),
  8. connectionCallback, callback);

代码示例来源:origin: iterate-ch/cyberduck

  1. @Override
  2. public Path move(final Path file, final Path renamed, TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException {
  3. try {
  4. if(status.isExists()) {
  5. delete.delete(Collections.singletonList(renamed), connectionCallback, callback);
  6. }
  7. session.sftp().rename(file.getAbsolute(), renamed.getAbsolute());
  8. // Copy original file attributes
  9. return new Path(renamed.getParent(), renamed.getName(), renamed.getType(), new PathAttributes(file.attributes()));
  10. }
  11. catch(IOException e) {
  12. throw new SFTPExceptionMappingService().map("Cannot rename {0}", e, file);
  13. }
  14. }

代码示例来源:origin: iterate-ch/cyberduck

  1. @Override
  2. public Path move(final Path file, final Path renamed, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException {
  3. try {
  4. if(status.isExists()) {
  5. delete.delete(Collections.singletonList(renamed), connectionCallback, callback);
  6. }
  7. final RelocationResult result = new DbxUserFilesRequests(session.getClient()).moveV2(file.getAbsolute(), renamed.getAbsolute());
  8. // Copy original file attributes
  9. return new Path(renamed.getParent(), renamed.getName(), renamed.getType(),
  10. new DropboxAttributesFinderFeature(session).toAttributes(result.getMetadata()));
  11. }
  12. catch(DbxException e) {
  13. throw new DropboxExceptionMappingService().map("Cannot move {0}", e, file);
  14. }
  15. }

代码示例来源:origin: iterate-ch/cyberduck

  1. @Override
  2. public Path move(final Path file, final Path renamed, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException {
  3. try {
  4. if(status.isExists()) {
  5. delete.delete(Collections.singletonList(renamed), connectionCallback, callback);
  6. }
  7. if(!session.getClient().rename(file.getAbsolute(), renamed.getAbsolute())) {
  8. throw new FTPException(session.getClient().getReplyCode(), session.getClient().getReplyString());
  9. }
  10. // Copy original file attributes
  11. return new Path(renamed.getParent(), renamed.getName(), renamed.getType(), new PathAttributes(file.attributes()));
  12. }
  13. catch(IOException e) {
  14. throw new FTPExceptionMappingService().map("Cannot rename {0}", e, file);
  15. }
  16. }

代码示例来源:origin: iterate-ch/cyberduck

  1. try {
  2. if(status.isExists()) {
  3. delete.delete(Collections.singletonList(renamed), connectionCallback, callback);

代码示例来源:origin: iterate-ch/cyberduck

  1. @Override
  2. public Path move(final Path file, final Path renamed, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException {
  3. if(status.isExists()) {
  4. delete.delete(Collections.singletonList(renamed), connectionCallback, callback);

相关文章