Include part size in listMultipartUpload result

Clients use this during completeMultipartUpload.
This commit is contained in:
Andrew Gaul 2016-11-08 17:23:02 -08:00
parent fc14dce5ce
commit 95c4011982
1 changed files with 3 additions and 2 deletions

View File

@ -864,7 +864,8 @@ public final class LocalBlobStore implements BlobStore {
.payload(payload) .payload(payload)
.build(); .build();
String partETag = putBlob(mpu.containerName(), blob); 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); return MultipartPart.create(partNumber, partSize, partETag);
} }
@ -880,7 +881,7 @@ public final class LocalBlobStore implements BlobStore {
continue; continue;
} }
int partNumber = Integer.parseInt(sm.getName().substring((MULTIPART_PREFIX + mpu.id() + "-" + mpu.blobName() + "-").length())); 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())); parts.add(MultipartPart.create(partNumber, partSize, sm.getETag()));
} }
if (pageSet.isEmpty() || pageSet.getNextMarker() == null) { if (pageSet.isEmpty() || pageSet.getNextMarker() == null) {