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
Bucket is a class that contains all information of a bucket, in contrast with BucketInfo, the Bucket class also exposes methods to update and delete the bucket. Bucket objects cannot be created directly but are returned by Storage methods like create and get.
To check for the existence of a bucket if you do not have an instance of Bucket you can do the following:
storage.get will return a Bucket object or null if not found. Storage.BucketGetOption.fields() tells the service to return only the bucket name (we don't need to transfer all bucket's fields to check for existence).
@mziccard which package did you get your Storage class from?
I'm using com.google.api.services.storage.Storage and BucketGetOptions.fields() is not getting resolved.
Hi,
I still can't understand how can I use bucket.exists from the documentation. I don't even know how to instantiate a new bucket. This is what I did.
Bucket bucket = new Bucket("bucketname");
return bucket.exists();
Apparently I can't instantiate a new bucket like this, so how then can I use bucket.exists()?
The text was updated successfully, but these errors were encountered: