@Override public boolean isSupported(final Path source, final Path target) { return !containerService.isContainer(source); }
@Override public boolean isSupported(final Path source, final Path target) { return !containerService.isContainer(source) && !containerService.isContainer(target); } }
@Override public boolean isSupported(final Path source, final Path target) { return !containerService.isContainer(source) && !containerService.isContainer(target); } }
@Override public boolean isSupported(final Path source, final Path target) { return !containerService.isContainer(source) && !containerService.isContainer(target); } }
@Override public boolean isSupported(final Path source, final Path target) { return !containerService.isContainer(source); }
@Override public boolean isSupported(final Path source, final Path target) { return !containerService.isContainer(source); }
@Override public boolean isContainer(final Path file) { return super.isContainer(file) || file.getType().contains(Path.Type.volume); } }
@Override public boolean isContainer(final Path file) { return super.isContainer(file) || file.getType().contains(Path.Type.volume); }
/** * @return Default path or root with volume attributes set */ public Path getContainer(final Path file) { if(file.isRoot()) { return file; } Path container = file; while(!this.isContainer(container)) { container = container.getParent(); } return container; }
@Override public Acl getPermission(final Path file) { if(containerService.isContainer(file)) { return containerService.getContainer(file).attributes().getAcl(); } return Acl.EMPTY; }
@Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { if(containerService.isContainer(folder)) { final GoogleStorageBucketCreateService service = new GoogleStorageBucketCreateService(session); service.create(folder, region); return folder; } else { return super.mkdir(folder, region, status); } } }
@Override public Path find() throws BackgroundException { final Path home = super.find(); if(containerService.isContainer(home)) { return new Path(home.getParent(), home.getName(), EnumSet.of(Path.Type.volume, Path.Type.directory)); } return home; }
@Override public Path find(final Path root, final String path) { final Path home = super.find(root, path); if(containerService.isContainer(home)) { return new Path(home.getParent(), home.getName(), EnumSet.of(Path.Type.volume, Path.Type.directory)); } return home; } }
@Override public Algorithm getEncryption(final Path file) throws BackgroundException { if(containerService.isContainer(file)) { final String key = String.format("s3.encryption.key.%s", containerService.getContainer(file).getName()); if(StringUtils.isNotBlank(preferences.getProperty(key))) { return Algorithm.fromString(preferences.getProperty(key)); } } return super.getEncryption(file); }
/** * @return Path relative to the container name */ public String getKey(final Path file) { if(file.isRoot()) { return null; } if(this.isContainer(file)) { return null; } return PathRelativizer.relativize(this.getContainer(file).getAbsolute(), file.getAbsolute()); } }
@Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { if(containerService.isContainer(folder)) { return super.mkdir(folder, region, status); } else { if(Checksum.NONE == status.getChecksum()) { status.setChecksum(writer.checksum(folder).compute(new NullInputStream(0L), status)); } return super.mkdir(folder, region, status); } } }
@Override public boolean isSupported(final Path file) { if(containerService.isContainer(file)) { if(PreferencesFactory.get().getBoolean("sds.delete.dataroom.enable")) { // Need the query permission on the parent data room if file itself is subroom new SDSPermissionsFeature(session, nodeid).containsRole(containerService.getContainer(file.getParent()), SDSPermissionsFeature.MANAGE_ROLE); } return false; } return new SDSPermissionsFeature(session, nodeid).containsRole(file, SDSPermissionsFeature.DELETE_ROLE); }
public DefaultPathPredicate(final Path file) { final Path.Type type = file.isSymbolicLink() ? Path.Type.symboliclink : file.isFile() ? Path.Type.file : Path.Type.directory; String qualifier = StringUtils.EMPTY; if(StringUtils.isNotBlank(file.attributes().getRegion())) { if(new PathContainerService().isContainer(file)) { qualifier += file.attributes().getRegion(); } } if(file.isFile()) { if(StringUtils.isNotBlank(file.attributes().getVersionId())) { qualifier += file.attributes().getVersionId(); } } final String path = file.getAbsolute(); reference = "[" + type + "]" + "-" + qualifier + path; }
@Override public PathAttributes find(final Path file) throws BackgroundException { if(file.isRoot()) { return PathAttributes.EMPTY; } if(file.getType().contains(Path.Type.upload)) { return PathAttributes.EMPTY; } if(containerService.isContainer(file)) { final PathAttributes attributes = new PathAttributes(); attributes.setRegion(new S3LocationFeature(session, session.getClient().getRegionEndpointCache()).getLocation(file).getIdentifier()); return attributes; } return this.toAttributes(this.details(file)); }
@Override public PathAttributes find(final Path file) throws BackgroundException { if(file.isRoot()) { return PathAttributes.EMPTY; } if(new PathContainerService().isContainer(file)) { return PathAttributes.EMPTY; } final AttributedList<Path> list = new FileidDriveListService(session, fileid, file).list(file.getParent(), new DisabledListProgressListener()); final Path found = list.find(new DriveFileidProvider.IgnoreTrashedPathPredicate(file)); if(null == found) { throw new NotfoundException(file.getAbsolute()); } return found.attributes(); }