JCLOUDS-894: Use prefix when listing MPU on Swift

Previously we only used the blob name and not the blob
name/slo/timestamp/part size cookie which yield extra parts when
listing an MPU with parts from a previous MPU.  Listing using the
stricter prefix gives the expected results.
Fixes andrewgaul/s3proxy#91.
This commit is contained in:
Andrew Gaul 2015-11-13 12:12:02 -08:00
parent 41ce90ec36
commit 22c789da9e
1 changed files with 1 additions and 1 deletions

View File

@ -479,7 +479,7 @@ public class RegionScopedSwiftBlobStore implements BlobStore {
public List<MultipartPart> listMultipartUpload(MultipartUpload mpu) { public List<MultipartPart> listMultipartUpload(MultipartUpload mpu) {
ImmutableList.Builder<MultipartPart> parts = ImmutableList.builder(); ImmutableList.Builder<MultipartPart> parts = ImmutableList.builder();
PageSet<? extends StorageMetadata> pageSet = list(mpu.containerName(), PageSet<? extends StorageMetadata> pageSet = list(mpu.containerName(),
new ListContainerOptions().inDirectory(mpu.blobName()).recursive()); new ListContainerOptions().prefix(mpu.id() + "/"));
// TODO: pagination // TODO: pagination
for (StorageMetadata sm : pageSet) { for (StorageMetadata sm : pageSet) {
int lastSlash = sm.getName().lastIndexOf('/'); int lastSlash = sm.getName().lastIndexOf('/');