From 95c4011982c05c17f1e5b59654bfc91da896869a Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Tue, 8 Nov 2016 17:23:02 -0800 Subject: [PATCH] Include part size in listMultipartUpload result Clients use this during completeMultipartUpload. --- .../java/org/jclouds/blobstore/config/LocalBlobStore.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/blobstore/src/main/java/org/jclouds/blobstore/config/LocalBlobStore.java b/blobstore/src/main/java/org/jclouds/blobstore/config/LocalBlobStore.java index 63f2e3eef2..b20f40e2fb 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/config/LocalBlobStore.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/config/LocalBlobStore.java @@ -864,7 +864,8 @@ public final class LocalBlobStore implements BlobStore { .payload(payload) .build(); String partETag = putBlob(mpu.containerName(), blob); - long partSize = -1; // TODO: how to get this from payload? + BlobMetadata metadata = blobMetadata(mpu.containerName(), partName); // TODO: racy, how to get this from payload? + long partSize = metadata.getContentMetadata().getContentLength(); return MultipartPart.create(partNumber, partSize, partETag); } @@ -880,7 +881,7 @@ public final class LocalBlobStore implements BlobStore { continue; } int partNumber = Integer.parseInt(sm.getName().substring((MULTIPART_PREFIX + mpu.id() + "-" + mpu.blobName() + "-").length())); - long partSize = -1; // TODO: could call getContentMetadata but did not above + long partSize = sm.getSize(); parts.add(MultipartPart.create(partNumber, partSize, sm.getETag())); } if (pageSet.isEmpty() || pageSet.getNextMarker() == null) {