You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to list every object in a bucket and add it to a list.
I want to use code similar to this:
Storage.BlobListOption blobListOption = null;
do {
page = this.gcs.list(path, blobListOption);
for (BlobInfo blob : page.getValues()) {
blobs.add(blob);
}
blobListOption = Storage.BlobListOption.pageToken(page.getNextPageToken());
} while (page.hasNextPage());
This code blows up with an NPE as expected. In order to make it work, I either need to duplicate the logic inside the while loop to get the first page with a this.gcs.list(path) call, or add a bogus Storage.BlobListOption, like Storage.BlobListOption.pageSize(50) instead of null at the beginning.
To support cases like this, there should be a Storage.BlobListOption factory for an empty Storage.BlobListOption.
I want to list every object in a bucket and add it to a list.
I want to use code similar to this:
This code blows up with an NPE as expected. In order to make it work, I either need to duplicate the logic inside the while loop to get the first page with a
this.gcs.list(path)call, or add a bogusStorage.BlobListOption, likeStorage.BlobListOption.pageSize(50)instead ofnullat the beginning.To support cases like this, there should be a
Storage.BlobListOptionfactory for an emptyStorage.BlobListOption.Unless I'm missing anything?