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

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

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

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

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

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

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

  1. @Override
  2. public DescriptiveUrlBag toUrl(final Path file) {
  3. if(file.isVolume()) {
  4. return DescriptiveUrlBag.empty();
  5. }
  6. final DescriptiveUrlBag list = new DescriptiveUrlBag();
  7. if(file.isFile()) {
  8. final String download = String.format("%s/file/%s/%s", session.getClient().getDownloadUrl(),
  9. URIEncoder.encode(containerService.getContainer(file).getName()),
  10. URIEncoder.encode(containerService.getKey(file)));
  11. list.add(new DescriptiveUrl(URI.create(download), DescriptiveUrl.Type.http,
  12. MessageFormat.format(LocaleFactory.localizedString("{0} URL"), Scheme.https.name().toUpperCase(Locale.ROOT))));
  13. }
  14. return list;
  15. }
  16. }

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

  1. protected void write(final Session<?> session, final AclPermission feature, final Path file) throws BackgroundException {
  2. if(this.isCanceled()) {
  3. throw new ConnectionCanceledException();
  4. }
  5. listener.message(MessageFormat.format(LocaleFactory.localizedString("Changing permission of {0} to {1}", "Status"),
  6. file.getName(), acl));
  7. feature.setPermission(file, acl);
  8. if(file.isVolume()) {
  9. // No recursion when changing container ACL
  10. }
  11. else if(file.isDirectory()) {
  12. if(callback.recurse(file, acl)) {
  13. for(Path child : session.getFeature(ListService.class).list(file, new WorkerListProgressListener(this, listener))) {
  14. this.write(session, feature, child);
  15. }
  16. }
  17. }
  18. }

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

  1. private void addNavigation(final Path p) {
  2. pathPopupButton.addItemWithTitle(p.getAbsolute());
  3. pathPopupButton.lastItem().setRepresentedObject(p.getAbsolute());
  4. if(p.isVolume()) {
  5. pathPopupButton.lastItem().setImage(IconCacheFactory.<NSImage>get().volumeIcon(pool.getHost().getProtocol(), 16));
  6. }
  7. else {
  8. pathPopupButton.lastItem().setImage(IconCacheFactory.<NSImage>get().fileIcon(p, 16));
  9. }
  10. }

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

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

相关文章