Skip to content

Commit cc160b5

Browse files
listblob startsFrom changes (#46220)
* listblob startsFrom changes * adding recordings * fixing review comments * adding listblobsbyhierachy tests
1 parent 1335247 commit cc160b5

File tree

8 files changed

+232
-84
lines changed

8 files changed

+232
-84
lines changed

sdk/storage/azure-storage-blob/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "java",
44
"TagPrefix": "java/storage/azure-storage-blob",
5-
"Tag": "java/storage/azure-storage-blob_80c07fe827"
5+
"Tag": "java/storage/azure-storage-blob_098e26235c"
66
}

sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerAsyncClient.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,9 +1172,10 @@ PagedFlux<BlobItem> listBlobsFlatWithOptionalTimeout(ListBlobsOptions options, S
11721172
ArrayList<ListBlobsIncludeItem> include
11731173
= options.getDetails().toList().isEmpty() ? null : options.getDetails().toList();
11741174

1175-
return StorageImplUtils.applyOptionalTimeout(this.azureBlobStorage.getContainers()
1176-
.listBlobFlatSegmentWithResponseAsync(containerName, options.getPrefix(), marker,
1177-
options.getMaxResultsPerPage(), include, null, null, Context.NONE),
1175+
return StorageImplUtils.applyOptionalTimeout(
1176+
this.azureBlobStorage.getContainers()
1177+
.listBlobFlatSegmentWithResponseAsync(containerName, options.getPrefix(), marker,
1178+
options.getMaxResultsPerPage(), include, options.getStartFrom(), null, null, Context.NONE),
11781179
timeout);
11791180
}
11801181

@@ -1301,7 +1302,8 @@ PagedFlux<BlobItem> listBlobsHierarchyWithOptionalTimeout(String delimiter, List
13011302
// Note that this prefers the value passed to .byPage(int) over the value on the options
13021303
finalOptions = new ListBlobsOptions().setMaxResultsPerPage(pageSize)
13031304
.setPrefix(options.getPrefix())
1304-
.setDetails(options.getDetails());
1305+
.setDetails(options.getDetails())
1306+
.setStartFrom(options.getStartFrom());
13051307
}
13061308
} else {
13071309
finalOptions = options;
@@ -1337,9 +1339,10 @@ PagedFlux<BlobItem> listBlobsHierarchyWithOptionalTimeout(String delimiter, List
13371339
ArrayList<ListBlobsIncludeItem> include
13381340
= options.getDetails().toList().isEmpty() ? null : options.getDetails().toList();
13391341

1340-
return StorageImplUtils.applyOptionalTimeout(this.azureBlobStorage.getContainers()
1341-
.listBlobHierarchySegmentWithResponseAsync(containerName, delimiter, options.getPrefix(), marker,
1342-
options.getMaxResultsPerPage(), include, null, null, Context.NONE),
1342+
return StorageImplUtils.applyOptionalTimeout(
1343+
this.azureBlobStorage.getContainers()
1344+
.listBlobHierarchySegmentWithResponseAsync(containerName, delimiter, options.getPrefix(), marker,
1345+
options.getMaxResultsPerPage(), include, options.getStartFrom(), null, null, Context.NONE),
13431346
timeout);
13441347
}
13451348

sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClient.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,9 @@ public PagedIterable<BlobItem> listBlobs(ListBlobsOptions options, String contin
10291029
if (options != null) {
10301030
finalOptions.setMaxResultsPerPage(options.getMaxResultsPerPage())
10311031
.setPrefix(options.getPrefix())
1032+
.setStartFrom(options.getStartFrom())
10321033
.setDetails(options.getDetails());
1034+
10331035
}
10341036
/*
10351037
If pageSize was not set in a .byPage(int) method, the page size from options will be preserved.
@@ -1044,7 +1046,8 @@ public PagedIterable<BlobItem> listBlobs(ListBlobsOptions options, String contin
10441046
Callable<ResponseBase<ContainersListBlobFlatSegmentHeaders, ListBlobsFlatSegmentResponse>> operation
10451047
= () -> this.azureBlobStorage.getContainers()
10461048
.listBlobFlatSegmentWithResponse(containerName, finalOptions.getPrefix(), nextMarker,
1047-
finalOptions.getMaxResultsPerPage(), include, null, null, Context.NONE);
1049+
finalOptions.getMaxResultsPerPage(), include, finalOptions.getStartFrom(), null, null,
1050+
Context.NONE);
10481051

10491052
ResponseBase<ContainersListBlobFlatSegmentHeaders, ListBlobsFlatSegmentResponse> response
10501053
= StorageImplUtils.sendRequest(operation, timeout, BlobStorageException.class);
@@ -1162,7 +1165,8 @@ public PagedIterable<BlobItem> listBlobsByHierarchy(String delimiter, ListBlobsO
11621165
if (options != null) {
11631166
finalOptions.setMaxResultsPerPage(options.getMaxResultsPerPage())
11641167
.setPrefix(options.getPrefix())
1165-
.setDetails(options.getDetails());
1168+
.setDetails(options.getDetails())
1169+
.setStartFrom(options.getStartFrom());
11661170
}
11671171
/*
11681172
If pageSize was not set in a .byPage(int) method, the page size from options will be preserved.
@@ -1188,7 +1192,7 @@ private PagedResponse<BlobItem> listBlobsHierarchySegment(String marker, String
11881192
Callable<ResponseBase<ContainersListBlobHierarchySegmentHeaders, ListBlobsHierarchySegmentResponse>> operation
11891193
= () -> azureBlobStorage.getContainers()
11901194
.listBlobHierarchySegmentWithResponse(containerName, delimiter, options.getPrefix(), marker,
1191-
options.getMaxResultsPerPage(), include, null, null, Context.NONE);
1195+
options.getMaxResultsPerPage(), include, options.getStartFrom(), null, null, Context.NONE);
11921196

11931197
ResponseBase<ContainersListBlobHierarchySegmentHeaders, ListBlobsHierarchySegmentResponse> response
11941198
= StorageImplUtils.sendRequest(operation, timeout, BlobStorageException.class);

0 commit comments

Comments
 (0)