From 770bcce7e2d2b97a0e0858eb421b8cfb5a0b645d Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Sat, 9 Nov 2024 17:37:38 -0800 Subject: [PATCH] JCLOUDS-1639: Allow filtering Azure getBlockList --- .../java/org/jclouds/azureblob/AzureBlobClient.java | 11 +++++++++++ .../jclouds/azureblob/blobstore/AzureBlobStore.java | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobClient.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobClient.java index 31f991104f..76db242f8d 100644 --- a/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobClient.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobClient.java @@ -394,6 +394,7 @@ public interface AzureBlobClient extends Closeable { @PathParam("name") @ParamParser(BlobName.class) @BinderParam(BindAzureBlobMetadataToMultipartRequest.class) AzureBlob object, @BinderParam(BindAzureBlocksToRequest.class) List blockIdList); + @Deprecated @Named("GetBlockList") @GET @Path("{container}/{name}") @@ -403,6 +404,16 @@ public interface AzureBlobClient extends Closeable { @PathParam("container") @ParamValidators(ContainerNameValidator.class) String container, @PathParam("name") String name); + @Named("GetBlockList") + @GET + @Path("{container}/{name}") + @XMLResponseParser(BlobBlocksResultsHandler.class) + @QueryParams(keys = { "comp" }, values = { "blocklist" }) + ListBlobBlocksResponse getBlockList( + @PathParam("container") @ParamValidators(ContainerNameValidator.class) String container, + @PathParam("name") String name, + // valid values are committed, uncommitted, or all + @QueryParam("blocklisttype") String blockListType); /** * The Get Blob Properties operation returns all user-defined metadata, standard HTTP properties, diff --git a/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/AzureBlobStore.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/AzureBlobStore.java index 147ce0cc9b..1dc63a2457 100644 --- a/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/AzureBlobStore.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/AzureBlobStore.java @@ -458,7 +458,7 @@ public class AzureBlobStore extends BaseBlobStore { public List listMultipartUpload(MultipartUpload mpu) { ListBlobBlocksResponse response; try { - response = sync.getBlockList(mpu.containerName(), mpu.blobName()); + response = sync.getBlockList(mpu.containerName(), mpu.blobName(), "uncommitted"); } catch (KeyNotFoundException knfe) { return ImmutableList.of(); }