Use prefix instead of marker to list MPU parts

This commit is contained in:
Andrew Gaul 2015-06-30 13:43:01 -07:00
parent aade18b76d
commit d109dd6326
1 changed files with 1 additions and 4 deletions

View File

@ -827,12 +827,9 @@ public final class LocalBlobStore implements BlobStore {
public List<MultipartPart> listMultipartUpload(MultipartUpload mpu) {
ImmutableList.Builder<MultipartPart> parts = ImmutableList.builder();
PageSet<? extends StorageMetadata> pageSet = list(mpu.containerName(),
new ListContainerOptions().afterMarker(mpu.blobName()));
new ListContainerOptions().prefix(mpu.blobName() + "-").recursive());
// TODO: pagination
for (StorageMetadata sm : pageSet) {
if (!sm.getName().startsWith(mpu.blobName() + "-")) {
break;
}
int partNumber = Integer.parseInt(sm.getName().substring((mpu.blobName() + "-").length()));
long partSize = -1; // TODO: could call getContentMetadata but did not above
parts.add(MultipartPart.create(partNumber, partSize, sm.getETag()));