Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Commit 770bcce

Browse files
committed
JCLOUDS-1639: Allow filtering Azure getBlockList
1 parent 5b65094 commit 770bcce

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobClient.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ String putBlockList(@PathParam("container") @ParamValidators(ContainerNameValida
394394
@PathParam("name") @ParamParser(BlobName.class) @BinderParam(BindAzureBlobMetadataToMultipartRequest.class) AzureBlob object,
395395
@BinderParam(BindAzureBlocksToRequest.class) List<String> blockIdList);
396396

397+
@Deprecated
397398
@Named("GetBlockList")
398399
@GET
399400
@Path("{container}/{name}")
@@ -403,6 +404,16 @@ ListBlobBlocksResponse getBlockList(
403404
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
404405
@PathParam("name") String name);
405406

407+
@Named("GetBlockList")
408+
@GET
409+
@Path("{container}/{name}")
410+
@XMLResponseParser(BlobBlocksResultsHandler.class)
411+
@QueryParams(keys = { "comp" }, values = { "blocklist" })
412+
ListBlobBlocksResponse getBlockList(
413+
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
414+
@PathParam("name") String name,
415+
// valid values are committed, uncommitted, or all
416+
@QueryParam("blocklisttype") String blockListType);
406417

407418
/**
408419
* The Get Blob Properties operation returns all user-defined metadata, standard HTTP properties,

providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/AzureBlobStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ public MultipartPart uploadMultipartPart(MultipartUpload mpu, int partNumber, Pa
458458
public List<MultipartPart> listMultipartUpload(MultipartUpload mpu) {
459459
ListBlobBlocksResponse response;
460460
try {
461-
response = sync.getBlockList(mpu.containerName(), mpu.blobName());
461+
response = sync.getBlockList(mpu.containerName(), mpu.blobName(), "uncommitted");
462462
} catch (KeyNotFoundException knfe) {
463463
return ImmutableList.<MultipartPart>of();
464464
}

0 commit comments

Comments
 (0)