ch.cyberduck.core.Path.isChild()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(202)

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

Path.isChild介绍

暂无

代码示例

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

@Override
  public boolean accept(final Path file) {
    if(list.contains(file)) {
      return true;
    }
    for(Path f : list) {
      if(f.isChild(file)) {
        return true;
      }
    }
    return false;
  }
}

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

private boolean findTarget(final Path target, final Path root) {
    return target.equals(root) || target.isChild(root);
  }
}

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

/**
   * Prunes the list of selected files. Files which are a child of an already included directory
   * are removed from the returned list.
   *
   * @param selected Selected files for transfer
   * @return Normalized
   */
  public static List<Path> normalize(final List<Path> selected) {
    final List<Path> normalized = new Collection<Path>();
    for(Path f : selected) {
      boolean duplicate = false;
      for(Path n : normalized) {
        if(f.isChild(n)) {
          // The selected file is a child of a directory already included
          duplicate = true;
          break;
        }
      }
      if(!duplicate) {
        normalized.add(f);
      }
    }
    return normalized;
  }
}

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

for(Iterator<Path> normalizedIter = normalized.keySet().iterator(); normalizedIter.hasNext(); ) {
  Path n = normalizedIter.next();
  if(source.isChild(n)) {
    if(log.isDebugEnabled()) {
      log.debug(String.format("Remove path %s already included by directory", source.getAbsolute()));
    break;
  if(n.isChild(source)) {
    if(log.isDebugEnabled()) {
      log.debug(String.format("Remove path %s already included by directory", n.getAbsolute()));

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

@Override
public boolean contains(final Path file) {
  if(this.isUnlocked()) {
    return new SimplePathPredicate(file).test(home) || file.isChild(home);
  }
  return false;
}

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

for(Iterator<TransferItem> iter = normalized.iterator(); iter.hasNext(); ) {
  TransferItem n = iter.next();
  if(download.remote.isChild(n.remote)) {
  if(n.remote.isChild(download.remote)) {
    iter.remove();

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

protected boolean isUserWritable(final Path file) {
  final MantaAccountHomeInfo account = new MantaAccountHomeInfo(host.getCredentials().getUsername(), host.getDefaultPath());
  return file.equals(account.getAccountPublicRoot())
    || file.equals(account.getAccountPrivateRoot())
    || file.isChild(account.getAccountPublicRoot())
    || file.isChild(account.getAccountPrivateRoot());
}

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

protected boolean isWorldReadable(final Path file) {
  final MantaAccountHomeInfo account = new MantaAccountHomeInfo(host.getCredentials().getUsername(), host.getDefaultPath());
  return file.isChild(account.getAccountPublicRoot());
}

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

return false;
if(file.isChild(SharepointListService.DEFAULT_NAME)) {
else if(file.isChild(SharepointListService.GROUPS_NAME)) {

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

@Override
public void delete(final List<Path> files, final PasswordCallback prompt, final Callback callback) throws BackgroundException {
  final List<Path> deleted = new ArrayList<Path>();
  for(Path file : files) {
    boolean skip = false;
    for(Path d : deleted) {
      if(file.isChild(d)) {
        skip = true;
        break;
      }
    }
    if(skip) {
      continue;
    }
    deleted.add(file);
    callback.delete(file);
    try {
      session.getClient().delete(new DAVPathEncoder().encode(file));
    }
    catch(SardineException e) {
      throw new DAVExceptionMappingService().map("Cannot delete {0}", e, file);
    }
    catch(IOException e) {
      throw new HttpExceptionMappingService().map(e, file);
    }
  }
}

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

throw new NotfoundException(directory.getAbsolute());
if(new SimplePathPredicate(directory).test(home) || directory.isChild(home)) {
  final PathAttributes attributes = new PathAttributes(directory.attributes());
  if(new SimplePathPredicate(directory).test(home)) {

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

boolean skip = false;
for(Path d : deleted) {
  if(file.isChild(d)) {
    skip = true;
    break;

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

if(next.isDirectory() && destination.isChild(next)) {

相关文章