Skip to content

Commit 0bb9438

Browse files
authored
Update Cloud Storage documentation with bug fix
The original code does not compile. There is a missing call to the iterator() method to obtain an Iterator instance.
1 parent 0c89651 commit 0bb9438

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

google-cloud-storage/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ Then add the following code to list all your buckets and all the blobs inside yo
123123

124124
```java
125125
// List all your buckets
126-
Iterator<Bucket> bucketIterator = storage.list().iterateAll();
126+
Iterator<Bucket> bucketIterator = storage.list().iterateAll().iterator();
127127
System.out.println("My buckets:");
128128
while (bucketIterator.hasNext()) {
129129
System.out.println(bucketIterator.next());
130130
}
131131

132132
// List the blobs in a particular bucket
133-
Iterator<Blob> blobIterator = bucket.list().iterateAll();
133+
Iterator<Blob> blobIterator = bucket.list().iterateAll().iterator();
134134
System.out.println("My blobs:");
135135
while (blobIterator.hasNext()) {
136136
System.out.println(blobIterator.next());

0 commit comments

Comments
 (0)