public class BucketInfo implements Serializable
Google Storage bucket metadata; See Also: Concepts and Terminology
Implements
SerializableStatic Methods
newBuilder(String name)
public static BucketInfo.Builder newBuilder(String name)
Returns a BucketInfo
builder where the bucket's name is set to the provided name.
Name | Description |
name | String |
Type | Description |
BucketInfo.Builder |
of(String name)
public static BucketInfo of(String name)
Creates a BucketInfo
object for the provided bucket name.
Name | Description |
name | String |
Type | Description |
BucketInfo |
Methods
equals(Object o)
public boolean equals(Object o)
Name | Description |
o | Object |
Type | Description |
boolean |
getAcl()
public List<Acl> getAcl()
Returns the bucket's access control configuration. See Also: About Access Control Lists
Type | Description |
List<Acl> |
getAutoclass()
public BucketInfo.Autoclass getAutoclass()
Returns the Autoclass configuration
Type | Description |
BucketInfo.Autoclass |
getCors()
public List<Cors> getCors()
Returns the bucket's Cross-Origin Resource Sharing (CORS) configuration. See Also: Cross-Origin Resource Sharing (CORS)
Type | Description |
List<Cors> |
getCreateTime() (deprecated)
public Long getCreateTime()
Deprecated. #getCreateTimeOffsetDateTime()
Returns the time at which the bucket was created.
Type | Description |
Long |
getCreateTimeOffsetDateTime()
public OffsetDateTime getCreateTimeOffsetDateTime()
Type | Description |
OffsetDateTime |
getCustomPlacementConfig()
public BucketInfo.CustomPlacementConfig getCustomPlacementConfig()
Returns the Custom Placement Configuration
Type | Description |
BucketInfo.CustomPlacementConfig |
getDefaultAcl()
public List<Acl> getDefaultAcl()
Returns the default access control configuration for this bucket's blobs. See Also: About Access Control Lists
Type | Description |
List<Acl> |
getDefaultEventBasedHold()
public Boolean getDefaultEventBasedHold()
Returns a Boolean
with either true
, null
and in certain cases
false
.
Case 1: true
the field com.google.cloud.storage.Storage.BucketField#DEFAULT_EVENT_BASED_HOLD is selected in a Storage#get(String, Storage.BucketGetOption...) and default event-based hold for the bucket is
enabled.
Case 2.1: null
the field com.google.cloud.storage.Storage.BucketField#DEFAULT_EVENT_BASED_HOLD is selected in a Storage#get(String, Storage.BucketGetOption...), but default event-based hold for the bucket
is not enabled. This case can be considered implicitly false
.
Case 2.2: null
the field com.google.cloud.storage.Storage.BucketField#DEFAULT_EVENT_BASED_HOLD is not selected in a
Storage#get(String, Storage.BucketGetOption...), and the state for this field is
unknown.
Case 3: false
default event-based hold is explicitly set to false using in a Builder#setDefaultEventBasedHold(Boolean) client side for a follow-up request e.g. Storage#update(BucketInfo, Storage.BucketTargetOption...) in which case the value of default
event-based hold will remain false
for the given instance.
Type | Description |
Boolean |
getDefaultKmsKeyName()
public String getDefaultKmsKeyName()
Returns the default Cloud KMS key to be applied to newly inserted objects in this bucket.
Type | Description |
String |
getDeleteRules()
public List<? extends BucketInfo.DeleteRule> getDeleteRules()
Returns bucket's lifecycle configuration as a number of delete rules. See Also: Lifecycle Management
Type | Description |
List<? extends com.google.cloud.storage.BucketInfo.DeleteRule> |
getEtag()
public String getEtag()
Returns HTTP 1.1 Entity tag for the bucket. See Also: Entity Tags
Type | Description |
String |
getGeneratedId()
public String getGeneratedId()
Returns the service-generated id for the bucket.
Type | Description |
String |
getIamConfiguration()
public BucketInfo.IamConfiguration getIamConfiguration()
Returns the IAM configuration
Type | Description |
BucketInfo.IamConfiguration |
getIndexPage()
public String getIndexPage()
Returns bucket's website index page. Behaves as the bucket's directory index where missing blobs are treated as potential directories.
Type | Description |
String |
getLabels()
public @Nullable Map<@NonNull String,@Nullable String> getLabels()
Returns the labels for this bucket.
Type | Description |
@org.checkerframework.checker.nullness.qual.Nullable java.util.Map<@org.checkerframework.checker.nullness.qual.NonNull java.lang.String,@org.checkerframework.checker.nullness.qual.Nullable java.lang.String> |
getLifecycleRules()
public @NonNull List<? extends BucketInfo.LifecycleRule> getLifecycleRules()
Type | Description |
@org.checkerframework.checker.nullness.qual.NonNull java.util.List<? extends com.google.cloud.storage.BucketInfo.LifecycleRule> |
getLocation()
public String getLocation()
Returns the bucket's location. Data for blobs in the bucket resides in physical storage within
this region or regions. If specifying more than one region customPlacementConfig
should be
set in conjunction.
See Also: Bucket Locations
Type | Description |
String |
getLocationType()
public String getLocationType()
Returns the bucket's locationType. See Also: Bucket LocationType
Type | Description |
String |
getLogging()
public BucketInfo.Logging getLogging()
Returns the Logging
Type | Description |
BucketInfo.Logging |
getMetageneration()
public Long getMetageneration()
Returns the metadata generation of this bucket.
Type | Description |
Long |
getName()
public String getName()
Returns the bucket's name.
Type | Description |
String |
getNotFoundPage()
public String getNotFoundPage()
Returns the custom object to return when a requested resource is not found.
Type | Description |
String |
getOwner()
public Acl.Entity getOwner()
Returns the bucket's owner. This is always the project team's owner group.
Type | Description |
Acl.Entity |
getRetentionEffectiveTime() (deprecated)
public Long getRetentionEffectiveTime()
Deprecated. Use #getRetentionPeriodDuration()
Returns the retention effective time a policy took effect if a retention policy is defined as a
Long
.
Type | Description |
Long |
getRetentionEffectiveTimeOffsetDateTime()
public OffsetDateTime getRetentionEffectiveTimeOffsetDateTime()
Returns the retention effective time a policy took effect if a retention policy is defined.
Type | Description |
OffsetDateTime |
getRetentionPeriod() (deprecated)
public Long getRetentionPeriod()
Deprecated. Use #getRetentionPeriodDuration()
Returns the retention policy retention period.
Type | Description |
Long |
getRetentionPeriodDuration()
public Duration getRetentionPeriodDuration()
Returns the retention policy retention period.
Type | Description |
Duration |
getRpo()
public Rpo getRpo()
Returns the bucket's recovery point objective (RPO). This defines how quickly data is replicated between regions in a dual-region bucket. Not defined for single-region buckets. See Also: <a href="https://cloud.google.com/storage/docs/turbo-replication"Turbo Replication"
Type | Description |
Rpo |
getSelfLink()
public String getSelfLink()
Returns the URI of this bucket as a string.
Type | Description |
String |
getStorageClass()
public StorageClass getStorageClass()
Returns the bucket's storage class. This defines how blobs in the bucket are stored and determines the SLA and the cost of storage. See Also: Storage Classes
Type | Description |
StorageClass |
getUpdateTime() (deprecated)
public Long getUpdateTime()
Deprecated. #getUpdateTimeOffsetDateTime()
Returns the last modification time of the bucket's metadata expressed as the number of milliseconds since the Unix epoch.
Type | Description |
Long |
getUpdateTimeOffsetDateTime()
public OffsetDateTime getUpdateTimeOffsetDateTime()
Type | Description |
OffsetDateTime |
hashCode()
public int hashCode()
Type | Description |
int |
requesterPays()
public Boolean requesterPays()
Returns a Boolean
with either true
, false
, and in a specific case
null
.
Case 1: true
the field com.google.cloud.storage.Storage.BucketField#BILLING
is selected in a Storage#get(String, Storage.BucketGetOption...) and requester pays for
the bucket is enabled.
Case 2: false
the field com.google.cloud.storage.Storage.BucketField#BILLING
in a Storage#get(String, Storage.BucketGetOption...) is selected and requester pays for
the bucket is disable.
Case 3: null
the field com.google.cloud.storage.Storage.BucketField#BILLING
in a Storage#get(String, Storage.BucketGetOption...) is not selected, the value is
unknown.
Type | Description |
Boolean |
retentionPolicyIsLocked()
public Boolean retentionPolicyIsLocked()
Returns a Boolean
with either true
or null
.
Case 1: true
the field com.google.cloud.storage.Storage.BucketField#RETENTION_POLICY is selected in a Storage#get(String, Storage.BucketGetOption...) and retention policy for the bucket is locked.
Case 2.1: null
the field com.google.cloud.storage.Storage.BucketField#RETENTION_POLICY is selected in a Storage#get(String, Storage.BucketGetOption...), but retention policy for the bucket is not
locked. This case can be considered implicitly false
.
Case 2.2: null
the field com.google.cloud.storage.Storage.BucketField#RETENTION_POLICY is not selected in a Storage#get(String, Storage.BucketGetOption...), and the state for this field is unknown.
Type | Description |
Boolean |
toBuilder()
public BucketInfo.Builder toBuilder()
Returns a builder for the current bucket.
Type | Description |
BucketInfo.Builder |
toString()
public String toString()
Type | Description |
String |
versioningEnabled()
public Boolean versioningEnabled()
Returns a Boolean
with either true
, null
and in certain cases
false
.
Case 1: true
the field com.google.cloud.storage.Storage.BucketField#VERSIONING is selected in a Storage#get(String, Storage.BucketGetOption...) and versions for the bucket is enabled.
Case 2.1: null
the field com.google.cloud.storage.Storage.BucketField#VERSIONING is selected in a Storage#get(String, Storage.BucketGetOption...), but versions for the bucket is not enabled.
This case can be considered implicitly false
.
Case 2.2: null
the field com.google.cloud.storage.Storage.BucketField#VERSIONING is not selected in a Storage#get(String, Storage.BucketGetOption...), and the state for this field is unknown.
Case 3: false
versions is explicitly set to false client side for a follow-up
request for example Storage#update(BucketInfo, Storage.BucketTargetOption...) in which
case the value of versions will remain false
for for the given instance.
Type | Description |
Boolean |