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

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

本文整理了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

@Override
public void delete(final List<Path> files, final PasswordCallback prompt, final Callback callback) throws BackgroundException {
  final Map<Vault, List<Path>> vaults = new HashMap<>();
  for(Path file : files) {
    final Vault vault = registry.find(session, file);
    final List<Path> sorted;
    if(vaults.containsKey(vault)) {
      sorted = vaults.get(vault);
    }
    else {
      sorted = new ArrayList<>();
    }
    sorted.add(file);
    vaults.put(vault, sorted);
  }
  for(Map.Entry<Vault, List<Path>> entry : vaults.entrySet()) {
    final Vault vault = entry.getKey();
    final Delete feature = vault.getFeature(session, Delete.class, proxy);
    feature.delete(entry.getValue(), prompt, callback);
  }
}

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

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

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

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

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

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

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

@Override
public List<Path> run(final Session<?> session) throws BackgroundException {
  final Delete delete = session.getFeature(Delete.class);
  final ListService list = session.getFeature(ListService.class);
  final List<Path> recursive = new ArrayList<Path>();
  for(Path file : files) {
    if(this.isCanceled()) {
      throw new ConnectionCanceledException();
    }
    recursive.addAll(this.compile(session.getHost(), delete, list, new WorkerListProgressListener(this, listener), file));
  }
  delete.delete(recursive, prompt, new Delete.Callback() {
    @Override
    public void delete(final Path file) {
      listener.message(MessageFormat.format(LocaleFactory.localizedString("Deleting {0}", "Status"),
        file.getName()));
    }
  });
  return recursive;
}

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

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

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

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

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

@Override
public Path move(final Path source, final Path target, final TransferStatus status, final Delete.Callback callback,
         final ConnectionCallback connectionCallback) throws BackgroundException {
  if(containerService.isContainer(source)) {
    if(new SimplePathPredicate(source.getParent()).test(target.getParent())) {
      // Rename only
      return proxy.move(source, target, status, callback, connectionCallback);
    }
  }
  if(nodeid.isEncrypted(source) ^ nodeid.isEncrypted(target)) {
    // Moving into or from an encrypted room
    final Copy copy = session.getFeature(Copy.class);
    if(log.isDebugEnabled()) {
      log.debug(String.format("Move %s to %s using copy feature %s", source, target, copy));
    }
    final Path c = copy.copy(source, target, status, connectionCallback);
    // Delete source file after copy is complete
    final Delete delete = session.getFeature(Delete.class);
    if(delete.isSupported(source)) {
      delete.delete(Collections.singletonList(source), connectionCallback, callback);
    }
    return c;
  }
  else {
    return proxy.move(source, target, status, callback, connectionCallback);
  }
}

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

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

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

@Override
public Path move(final Path file, final Path renamed, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException {
  try {
    final IRODSFileSystemAO fs = session.getClient();
    final IRODSFile s = fs.getIRODSFileFactory().instanceIRODSFile(file.getAbsolute());
    if(!s.exists()) {
      throw new NotfoundException(String.format("%s doesn't exist", file.getAbsolute()));
    }
    if(status.isExists()) {
      delete.delete(Collections.singletonList(renamed), connectionCallback, callback);
    }
    final IRODSFile d = fs.getIRODSFileFactory().instanceIRODSFile(renamed.getAbsolute());
    s.renameTo(d);
    return renamed;
  }
  catch(JargonException e) {
    throw new IRODSExceptionMappingService().map("Cannot rename {0}", e, file);
  }
}

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

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

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

@Override
public Path move(final Path file, final Path renamed, TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException {
  try {
    if(status.isExists()) {
      delete.delete(Collections.singletonList(renamed), connectionCallback, callback);
    }
    session.sftp().rename(file.getAbsolute(), renamed.getAbsolute());
    // Copy original file attributes
    return new Path(renamed.getParent(), renamed.getName(), renamed.getType(), new PathAttributes(file.attributes()));
  }
  catch(IOException e) {
    throw new SFTPExceptionMappingService().map("Cannot rename {0}", e, file);
  }
}

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

@Override
public Path move(final Path file, final Path renamed, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException {
  try {
    if(status.isExists()) {
      delete.delete(Collections.singletonList(renamed), connectionCallback, callback);
    }
    final RelocationResult result = new DbxUserFilesRequests(session.getClient()).moveV2(file.getAbsolute(), renamed.getAbsolute());
    // Copy original file attributes
    return new Path(renamed.getParent(), renamed.getName(), renamed.getType(),
      new DropboxAttributesFinderFeature(session).toAttributes(result.getMetadata()));
  }
  catch(DbxException e) {
    throw new DropboxExceptionMappingService().map("Cannot move {0}", e, file);
  }
}

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

@Override
public Path move(final Path file, final Path renamed, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException {
  try {
    if(status.isExists()) {
      delete.delete(Collections.singletonList(renamed), connectionCallback, callback);
    }
    if(!session.getClient().rename(file.getAbsolute(), renamed.getAbsolute())) {
      throw new FTPException(session.getClient().getReplyCode(), session.getClient().getReplyString());
    }
    // Copy original file attributes
    return new Path(renamed.getParent(), renamed.getName(), renamed.getType(), new PathAttributes(file.attributes()));
  }
  catch(IOException e) {
    throw new FTPExceptionMappingService().map("Cannot rename {0}", e, file);
  }
}

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

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

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

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

相关文章

微信公众号

最新文章

更多