@Override public PathAttributes find(final Path file) throws BackgroundException { return registry.find(session, file).getFeature(session, AttributesFinder.class, proxy) .withCache(cache) .find(file); }
if(local.exists()) { final PathAttributes attributes = attribute.find(file); if(local.attributes().getSize() == attributes.getSize()) { if(Checksum.NONE != attributes.getChecksum()) {
@Override public Path touch(final Path file, final TransferStatus status) throws BackgroundException { final Local temp = TemporaryFileServiceFactory.get().create(file); LocalTouchFactory.get().touch(temp); try { final T reply = feature.upload(file, temp, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), status, new DisabledConnectionCallback()); if(log.isDebugEnabled()) { log.debug(String.format("Received reply %s for creating file %s", reply, file)); } return new Path(file.getParent(), file.getName(), file.getType(), attributes.find(file)); } finally { temp.delete(); } }
@Override public PathAttributes find(final Path file) throws BackgroundException { if(file.isRoot()) { return PathAttributes.EMPTY; } try { final Path found = this.search(file); if(null == found) { throw new NotfoundException(file.getAbsolute()); } return found.attributes(); } catch(InteroperabilityException | AccessDeniedException | NotfoundException f) { log.warn(String.format("Failure listing directory %s. %s", file.getParent(), f.getMessage())); // Try native implementation final AttributesFinder feature = session._getFeature(AttributesFinder.class); if(feature instanceof DefaultAttributesFinderFeature) { throw f; } return feature.withCache(cache).find(file); } }
@Override public Append append(final Path file, final Long length, final Cache<Path> cache) throws BackgroundException { if(finder.withCache(cache).find(file)) { final PathAttributes attr = attributes.withCache(cache).find(file); return new Append(attr.getSize()).withChecksum(attr.getChecksum()); } return Write.notfound; } }
/** * @return No Content-Range support */ @Override public Append append(final Path file, final Long length, final Cache<Path> cache) throws BackgroundException { if(length >= preferences.getLong("s3.upload.multipart.threshold")) { if(preferences.getBoolean("s3.upload.multipart")) { try { final List<MultipartUpload> upload = multipartService.find(file); if(!upload.isEmpty()) { Long size = 0L; for(MultipartPart completed : multipartService.list(upload.iterator().next())) { size += completed.getSize(); } return new Append(size); } } catch(AccessDeniedException | InteroperabilityException e) { log.warn(String.format("Ignore failure listing incomplete multipart uploads. %s", e.getDetail())); } } } if(finder.withCache(cache).find(file)) { final PathAttributes attr = attributes.withCache(cache).find(file); return new Append(false, true).withSize(attr.getSize()).withChecksum(attr.getChecksum()); } return Write.notfound; }
@Override public Append append(final Path file, final Long length, final Cache<Path> cache) throws BackgroundException { if(finder.withCache(cache).find(file)) { final PathAttributes attr = attributes.withCache(cache).find(file); return new Append(false, true).withSize(attr.getSize()).withChecksum(attr.getChecksum()); } return Write.notfound; }
@Override public Append append(final Path file, final Long length, final Cache<Path> cache) throws BackgroundException { if(finder.withCache(cache).find(file)) { final PathAttributes attributes = this.attributes.withCache(cache).find(file); return new Append(false, true).withSize(attributes.getSize()).withChecksum(attributes.getChecksum()); } return Write.notfound; }
@Override public Append append(final Path file, final Long length, final Cache<Path> cache) throws BackgroundException { if(finder.withCache(cache).find(file)) { final PathAttributes attr = attributes.withCache(cache).find(file); return new Append(false, true).withSize(attr.getSize()).withChecksum(attr.getChecksum()); } return Write.notfound; }
/** * Manta does not support raw append operations. */ @Override public Append append(final Path file, final Long length, final Cache<Path> cache) throws BackgroundException { if(finder.withCache(cache).find(file)) { final PathAttributes attr = attributes.withCache(cache).find(file); return new Append(false, true).withSize(attr.getSize()).withChecksum(attr.getChecksum()); } return Write.notfound; }
@Override public Append append(final Path file, final Long length, final Cache<Path> cache) throws BackgroundException { if(finder.withCache(cache).find(file)) { final PathAttributes attr = attributes.withCache(cache).find(file); return new Append(false, true).withSize(attr.getSize()).withChecksum(attr.getChecksum()); } return Write.notfound; }
@Override public Append append(final Path file, final Long length, final Cache<Path> cache) throws BackgroundException { if(finder.withCache(cache).find(file)) { final PathAttributes attr = attributes.withCache(cache).find(file); return new Append(false, true).withSize(attr.getSize()).withChecksum(attr.getChecksum()); } return Write.notfound; }
@Override public Append append(final Path file, final Long length, final Cache<Path> cache) throws BackgroundException { if(finder.withCache(cache).find(file)) { final PathAttributes attr = this.attributes.withCache(cache).find(file); return new Append(false, true).withSize(attr.getSize()).withChecksum(attr.getChecksum()); } return Write.notfound; }
@Override public Append append(final Path file, final Long length, final Cache<Path> cache) throws BackgroundException { if(finder.withCache(cache).find(file)) { final PathAttributes attr = attributes.withCache(cache).find(file); return new Append(false, true).withSize(attr.getSize()).withChecksum(attr.getChecksum()); } return Write.notfound; }
@Override public Append append(final Path file, final Long length, final Cache<Path> cache) throws BackgroundException { if(finder.withCache(cache).find(file)) { final PathAttributes attributes = this.attributes.withCache(cache).find(file); return new Append(false, true).withSize(attributes.getSize()).withChecksum(attributes.getChecksum()); } return Write.notfound; }
@Override public Append append(final Path file, final Long length, final Cache<Path> cache) throws BackgroundException { if(finder.withCache(cache).find(file)) { final PathAttributes attr = attributes.withCache(cache).find(file); return new Append(false, true).withSize(attr.getSize()).withChecksum(attr.getChecksum()); } return Write.notfound; } }
@Override public PathAttributes find(final Path file) throws BackgroundException { final PathAttributes attributes = new PathAttributes(delegate.withCache(new CryptoPathCache(cache)).find(vault.encrypt(session, file))); if(file.isFile()) { attributes.setSize(vault.toCleartextSize(attributes.getSize())); } return attributes; }
@Override public Append append(final Path file, final Long length, final Cache<Path> cache) throws BackgroundException { if(length >= preferences.getLong("b2.upload.largeobject.threshold")) { if(preferences.getBoolean("b2.upload.largeobject")) { final B2LargeUploadPartService partService = new B2LargeUploadPartService(session, fileid); final List<B2FileInfoResponse> upload = partService.find(file); if(!upload.isEmpty()) { Long size = 0L; for(B2UploadPartResponse completed : partService.list(upload.iterator().next().getFileId())) { size += completed.getContentLength(); } return new Append(size); } } } if(finder.withCache(cache).find(file)) { final PathAttributes attributes = this.attributes.withCache(cache).find(file); return new Append(false, true).withSize(attributes.getSize()).withChecksum(attributes.getChecksum()); } return Write.notfound; } }
@Override public Append append(final Path file, final Long length, final Cache<Path> cache) throws BackgroundException { if(finder.withCache(cache).find(vault.encrypt(session, file))) { final PathAttributes attributes = this.attributes.withCache(cache).find(vault.encrypt(session, file)); return new Append(false, true).withSize(attributes.getSize()).withChecksum(attributes.getChecksum()); } return Write.notfound; }
@Override public Append append(final Path file, final Long length, final Cache<Path> cache) throws BackgroundException { if(length >= preferences.getLong("openstack.upload.largeobject.threshold")) { if(preferences.getBoolean("openstack.upload.largeobject")) { long size = 0L; final List<Path> segments = listService.list(segmentService.getSegmentsDirectory(file, length), new DisabledListProgressListener()).toList(); if(segments.isEmpty()) { return Write.notfound; } for(Path segment : segments) { size += segment.attributes().getSize(); } return new Append(size); } } if(finder.withCache(cache).find(file)) { final PathAttributes attr = attributes.withCache(cache).find(file); return new Append(false, true).withSize(attr.getSize()).withChecksum(attr.getChecksum()); } return Write.notfound; }