You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Zack Shoylev <no...@github.com> on 2015/04/29 00:07:58 UTC

Re: [jclouds] JCLOUDS-894: Expose multipart upload component operations (#737)

> +      ImmutableList.Builder<Segment> builder = ImmutableList.builder();
> +      for (MultipartPart part : parts) {
> +         String path = mpu.containerName() + "/" + mpu.blobName() + "-" + part.partNumber();
> +         builder.add(Segment.builder().path(path).etag(part.partETag()).sizeBytes(part.partSize()).build());
> +      }
> +      Map<String, String> metadata = ImmutableMap.of();  // TODO: how to populate this from mpu.blobMetadata()?
> +      return api.getStaticLargeObjectApi(regionId, mpu.containerName()).replaceManifest(mpu.blobName(),
> +            builder.build(), metadata);
> +   }
> +
> +   @Override
> +   public MultipartPart uploadMultipartPart(MultipartUpload mpu, int partNumber, Payload payload) {
> +      String partName = mpu.blobName() + "-" + partNumber;
> +      String eTag = api.getObjectApi(regionId, mpu.containerName()).put(partName, payload);
> +      // TODO: only works for payloads where the caller specified the length.  How else can we get at the size?
> +      // ObjectApi.getWithoutBody does not return the size.

Actually content metadata returns the content-length without having to get the whole object.
http://docs.rackspace.com/files/api/v1/cf-devguide/content/HEAD_retrieveobjectmeta_v1__account___container___object__objectServicesOperations_d1e000.html

However, at the moment it gets filtered out I think. So this might require additional work first.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/737/files#r29293784