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

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

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

Path.isVolume介绍

暂无

代码示例

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

@Override
  public List<Acl.Role> getAvailableAclRoles(final List<Path> files) {
    final List<Acl.Role> roles = new ArrayList<Acl.Role>(Arrays.asList(
        new Acl.Role(org.jets3t.service.acl.Permission.PERMISSION_FULL_CONTROL.toString()),
        new Acl.Role(org.jets3t.service.acl.Permission.PERMISSION_READ.toString()))
    );
    for(Path file : files) {
      if(file.isVolume()) {
        // When applied to a bucket, this permission lets a user create objects, overwrite objects, and
        // delete objects in a bucket. This permission also lets a user list the contents of a bucket.
        // You cannot apply this permission to objects because bucket ACLs control who can upload,
        // overwrite, and delete objects. Also, you must grant READ permission if you grant WRITE permission.
        roles.add(new Acl.Role(org.jets3t.service.acl.Permission.PERMISSION_WRITE.toString()));
        break;
      }
    }
    return roles;
  }
}

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

public NSImage iconForPath(final Path item) {
  if(item.isVolume()) {
    return icons.volumeIcon(controller.getSession().getHost().getProtocol(), 16);
  }
  return icons.fileIcon(item, 16);
}

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

@Override
  public DescriptiveUrlBag toUrl(final Path file) {
    if(file.isVolume()) {
      return DescriptiveUrlBag.empty();
    }
    final DescriptiveUrlBag list = new DescriptiveUrlBag();
    if(file.isFile()) {
      final String download = String.format("%s/file/%s/%s", session.getClient().getDownloadUrl(),
        URIEncoder.encode(containerService.getContainer(file).getName()),
        URIEncoder.encode(containerService.getKey(file)));
      list.add(new DescriptiveUrl(URI.create(download), DescriptiveUrl.Type.http,
        MessageFormat.format(LocaleFactory.localizedString("{0} URL"), Scheme.https.name().toUpperCase(Locale.ROOT))));
    }
    return list;
  }
}

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

protected void write(final Session<?> session, final AclPermission feature, final Path file) throws BackgroundException {
  if(this.isCanceled()) {
    throw new ConnectionCanceledException();
  }
  listener.message(MessageFormat.format(LocaleFactory.localizedString("Changing permission of {0} to {1}", "Status"),
      file.getName(), acl));
  feature.setPermission(file, acl);
  if(file.isVolume()) {
    // No recursion when changing container ACL
  }
  else if(file.isDirectory()) {
    if(callback.recurse(file, acl)) {
      for(Path child : session.getFeature(ListService.class).list(file, new WorkerListProgressListener(this, listener))) {
        this.write(session, feature, child);
      }
    }
  }
}

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

private void addNavigation(final Path p) {
  pathPopupButton.addItemWithTitle(p.getAbsolute());
  pathPopupButton.lastItem().setRepresentedObject(p.getAbsolute());
  if(p.isVolume()) {
    pathPopupButton.lastItem().setImage(IconCacheFactory.<NSImage>get().volumeIcon(pool.getHost().getProtocol(), 16));
  }
  else {
    pathPopupButton.lastItem().setImage(IconCacheFactory.<NSImage>get().fileIcon(p, 16));
  }
}

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

if(file.isVolume()) {
  iconImageView.setImage(IconCacheFactory.<NSImage>get().volumeIcon(session.getHost().getProtocol(), 32));

相关文章