/** * parses the http response headers to create a new {@link MutableObjectInfoWithMetadata} object. */ public MutableObjectInfoWithMetadata apply(HttpResponse from) { BlobMetadata base = blobMetadataParser.apply(from); MutableObjectInfoWithMetadata to = blobToObjectInfo.apply(base); to.setBytes(attemptToParseSizeAndRangeFromHeaders(from)); to.setContainer(container); to.setUri(base.getUri()); String eTagHeader = from.getFirstHeaderOrNull("Etag"); if (eTagHeader != null) { to.setHash(base16().lowerCase().decode(eTagHeader)); } return to; }
/** * parses the http response headers to create a new {@link MutableObjectInfoWithMetadata} object. */ public MutableObjectInfoWithMetadata apply(HttpResponse from) { BlobMetadata base = blobMetadataParser.apply(from); MutableObjectInfoWithMetadata to = blobToObjectInfo.apply(base); to.setBytes(attemptToParseSizeAndRangeFromHeaders(from)); to.setContainer(container); to.setUri(base.getUri()); String eTagHeader = from.getFirstHeaderOrNull("Etag"); if (eTagHeader != null) { to.setHash(base16().lowerCase().decode(eTagHeader)); } return to; }
/** * First, calls {@link ParseSystemAndUserMetadataFromHeaders}. * * Then, sets the object size based on the Content-Length header and adds the content to the * {@link AtmosObject} result. * * @throws org.jclouds.http.HttpException */ public AtmosObject apply(HttpResponse from) { checkNotNull(from, "http response"); AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from)); object.getContentMetadata().setName(object.getSystemMetadata().getObjectName()); object.getContentMetadata().setPath(path); object.getContentMetadata().setUri(uri); object.getAllHeaders().putAll(from.getHeaders()); object.setPayload(from.getPayload()); object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from)); return object; }
/** * First, calls {@link ParseSystemAndUserMetadataFromHeaders}. * * Then, sets the object size based on the Content-Length header and adds the content to the * {@link AtmosObject} result. * * @throws org.jclouds.http.HttpException */ public AtmosObject apply(HttpResponse from) { checkNotNull(from, "http response"); AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from)); object.getContentMetadata().setName(object.getSystemMetadata().getObjectName()); object.getContentMetadata().setPath(path); object.getContentMetadata().setUri(uri); object.getAllHeaders().putAll(from.getHeaders()); object.setPayload(from.getPayload()); object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from)); return object; }
/** * First, calls {@link ParseSystemAndUserMetadataFromHeaders}. * * Then, sets the object size based on the Content-Length header and adds the content to the * {@link AtmosObject} result. * * @throws org.jclouds.http.HttpException */ public AtmosObject apply(HttpResponse from) { checkNotNull(from, "http response"); AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from)); object.getContentMetadata().setName(object.getSystemMetadata().getObjectName()); object.getContentMetadata().setPath(path); object.getContentMetadata().setUri(uri); object.getAllHeaders().putAll(from.getHeaders()); object.setPayload(from.getPayload()); object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from)); return object; }
/** * First, calls {@link ParseSystemAndUserMetadataFromHeaders}. * * Then, sets the object size based on the Content-Length header and adds the content to the * {@link AtmosObject} result. * * @throws org.jclouds.http.HttpException */ public AtmosObject apply(HttpResponse from) { checkNotNull(from, "http response"); AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from)); object.getContentMetadata().setName(object.getSystemMetadata().getObjectName()); object.getContentMetadata().setPath(path); object.getContentMetadata().setUri(uri); object.getAllHeaders().putAll(from.getHeaders()); object.setPayload(from.getPayload()); object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from)); return object; }
/** * First, calls {@link ParseSystemAndUserMetadataFromHeaders}. * * Then, sets the object size based on the Content-Length header and adds the content to the * {@link AtmosObject} result. * * @throws org.jclouds.http.HttpException */ public AtmosObject apply(HttpResponse from) { checkNotNull(from, "http response"); AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from)); object.getContentMetadata().setName(object.getSystemMetadata().getObjectName()); object.getContentMetadata().setPath(path); object.getContentMetadata().setUri(uri); object.getAllHeaders().putAll(from.getHeaders()); object.setPayload(from.getPayload()); object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from)); return object; }
/** * parses the http response headers to create a new {@link MutableObjectInfoWithMetadata} object. */ public MutableObjectInfoWithMetadata apply(HttpResponse from) { BlobMetadata base = blobMetadataParser.apply(from); MutableObjectInfoWithMetadata to = blobToObjectInfo.apply(base); to.setBytes(attemptToParseSizeAndRangeFromHeaders(from)); to.setContainer(container); to.setUri(base.getUri()); String eTagHeader = from.getFirstHeaderOrNull(HttpHeaders.ETAG); if (eTagHeader != null) { to.setHash(ETagUtils.convertHexETagToByteArray(eTagHeader)); } to.setObjectManifest(from.getFirstHeaderOrNull("X-Object-Manifest")); return to; }
/** * parses the http response headers to create a new {@link MutableObjectInfoWithMetadata} object. */ public MutableObjectInfoWithMetadata apply(HttpResponse from) { BlobMetadata base = blobMetadataParser.apply(from); MutableObjectInfoWithMetadata to = blobToObjectInfo.apply(base); to.setBytes(attemptToParseSizeAndRangeFromHeaders(from)); to.setContainer(container); to.setUri(base.getUri()); String eTagHeader = from.getFirstHeaderOrNull(HttpHeaders.ETAG); if (eTagHeader != null) { to.setHash(ETagUtils.convertHexETagToByteArray(eTagHeader)); } to.setObjectManifest(from.getFirstHeaderOrNull("X-Object-Manifest")); return to; }
/** * First, calls {@link ParseSystemAndUserMetadataFromHeaders}. * * Then, sets the object size based on the Content-Length header and adds the content to the * {@link AtmosObject} result. * * @throws org.jclouds.http.HttpException */ public AtmosObject apply(HttpResponse from) { checkNotNull(from, "http response"); AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from)); object.getContentMetadata().setName(object.getSystemMetadata().getObjectName()); object.getContentMetadata().setPath(path); object.getContentMetadata().setUri(uri); object.getAllHeaders().putAll(from.getHeaders()); object.setPayload(from.getPayload()); object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from)); object.getContentMetadata().setContentMD5(object.getSystemMetadata().getContentMD5()); return object; }
/** * First, calls {@link ParseSystemAndUserMetadataFromHeaders}. * * Then, sets the object size based on the Content-Length header and adds the content to the * {@link AtmosObject} result. * * @throws org.jclouds.http.HttpException */ public AtmosObject apply(HttpResponse from) { checkNotNull(from, "http response"); AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from)); object.getContentMetadata().setName(object.getSystemMetadata().getObjectName()); object.getContentMetadata().setPath(path); object.getContentMetadata().setUri(uri); object.getAllHeaders().putAll(from.getHeaders()); object.setPayload(from.getPayload()); object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from)); object.getContentMetadata().setContentMD5(object.getSystemMetadata().getContentMD5()); return object; }