diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/StorageSnippets.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/StorageSnippets.java index 438f3c1a455f..729b65b3b950 100644 --- a/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/StorageSnippets.java +++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/StorageSnippets.java @@ -273,6 +273,8 @@ public Blob getBlobFromIdWithMetageneration(String bucketName, String blobName, // [VARIABLE "bucket_"] public Page listBucketsWithSizeAndPrefix(String prefix) { // [START listBucketsWithSizeAndPrefix] + // Include a prefix of bucket-name to reduce search space. + // For more information read https://cloud.google.com/storage/docs/json_api/v1/buckets/list Page buckets = storage.list(BucketListOption.pageSize(100), BucketListOption.prefix(prefix)); for (Bucket bucket : buckets.iterateAll()) {