Class BucketInfo.Builder (2.22.2)

public abstract static class BucketInfo.Builder

Builder for BucketInfo.

Inheritance

java.lang.Object > BucketInfo.Builder

Methods

build()

public abstract BucketInfo build()

Creates a BucketInfo object.

Returns
TypeDescription
BucketInfo

deleteLifecycleRules()

public abstract BucketInfo.Builder deleteLifecycleRules()

Deletes the lifecycle rules of this bucket.

Returns
TypeDescription
BucketInfo.Builder

setAcl(Iterable<Acl> acl)

public abstract BucketInfo.Builder setAcl(Iterable<Acl> acl)

Sets the bucket's access control configuration. See Also: About Access Control Lists

Parameter
NameDescription
aclIterable<Acl>
Returns
TypeDescription
BucketInfo.Builder

setAutoclass(BucketInfo.Autoclass autoclass)

public abstract BucketInfo.Builder setAutoclass(BucketInfo.Autoclass autoclass)
Parameter
NameDescription
autoclassBucketInfo.Autoclass
Returns
TypeDescription
BucketInfo.Builder

setCors(Iterable<Cors> cors)

public abstract BucketInfo.Builder setCors(Iterable<Cors> cors)

Sets the bucket's Cross-Origin Resource Sharing (CORS) configuration. See Also: Cross-Origin Resource Sharing (CORS)

Parameter
NameDescription
corsIterable<Cors>
Returns
TypeDescription
BucketInfo.Builder

setCustomPlacementConfig(BucketInfo.CustomPlacementConfig customPlacementConfig)

public abstract BucketInfo.Builder setCustomPlacementConfig(BucketInfo.CustomPlacementConfig customPlacementConfig)
Parameter
NameDescription
customPlacementConfigBucketInfo.CustomPlacementConfig
Returns
TypeDescription
BucketInfo.Builder

setDefaultAcl(Iterable<Acl> acl)

public abstract BucketInfo.Builder setDefaultAcl(Iterable<Acl> acl)

Sets the default access control configuration to apply to bucket's blobs when no other configuration is specified. See Also: About Access Control Lists

Parameter
NameDescription
aclIterable<Acl>
Returns
TypeDescription
BucketInfo.Builder

setDefaultEventBasedHold(Boolean defaultEventBasedHold)

public abstract BucketInfo.Builder setDefaultEventBasedHold(Boolean defaultEventBasedHold)

Sets the default event-based hold for this bucket.

Parameter
NameDescription
defaultEventBasedHoldBoolean
Returns
TypeDescription
BucketInfo.Builder

setDefaultKmsKeyName(String defaultKmsKeyName)

public abstract BucketInfo.Builder setDefaultKmsKeyName(String defaultKmsKeyName)

Sets the default Cloud KMS key name for this bucket.

Parameter
NameDescription
defaultKmsKeyNameString
Returns
TypeDescription
BucketInfo.Builder

setDeleteRules(Iterable<? extends BucketInfo.DeleteRule> rules) (deprecated)

public abstract BucketInfo.Builder setDeleteRules(Iterable<? extends BucketInfo.DeleteRule> rules)

Deprecated. Use #setLifecycleRules(Iterable) instead, as in setLifecycleRules(Collections.singletonList( new BucketInfo.LifecycleRule( LifecycleAction.newDeleteAction(), LifecycleCondition.newBuilder().setAge(5).build())));

Sets the bucket's lifecycle configuration as a number of delete rules.

Parameter
NameDescription
rulesIterable<? extends com.google.cloud.storage.BucketInfo.DeleteRule>
Returns
TypeDescription
BucketInfo.Builder

setIamConfiguration(BucketInfo.IamConfiguration iamConfiguration)

public abstract BucketInfo.Builder setIamConfiguration(BucketInfo.IamConfiguration iamConfiguration)

Sets the IamConfiguration to specify whether IAM access should be enabled. See Also: Bucket Policy Only

Parameter
NameDescription
iamConfigurationBucketInfo.IamConfiguration
Returns
TypeDescription
BucketInfo.Builder

setIndexPage(String indexPage)

public abstract BucketInfo.Builder setIndexPage(String indexPage)

Sets the bucket's website index page. Behaves as the bucket's directory index where missing blobs are treated as potential directories.

Parameter
NameDescription
indexPageString
Returns
TypeDescription
BucketInfo.Builder

setLabels(@Nullable Map<@NonNull String,@Nullable String> labels)

public abstract BucketInfo.Builder setLabels(@Nullable Map<@NonNull String,@Nullable String> labels)

Sets the label of this bucket.

Parameter
NameDescription
labels@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>
Returns
TypeDescription
BucketInfo.Builder

setLifecycleRules(Iterable<? extends BucketInfo.LifecycleRule> rules)

public abstract BucketInfo.Builder setLifecycleRules(Iterable<? extends BucketInfo.LifecycleRule> rules)

Sets the bucket's lifecycle configuration as a number of lifecycle rules, consisting of an action and a condition. See Also: Object Lifecycle Management

Parameter
NameDescription
rulesIterable<? extends com.google.cloud.storage.BucketInfo.LifecycleRule>
Returns
TypeDescription
BucketInfo.Builder

setLocation(String location)

public abstract BucketInfo.Builder setLocation(String location)

Sets the bucket's location. Data for blobs in the bucket resides in physical storage within this region or regions. A list of supported values is available here.

Parameter
NameDescription
locationString
Returns
TypeDescription
BucketInfo.Builder

setLogging(BucketInfo.Logging logging)

public abstract BucketInfo.Builder setLogging(BucketInfo.Logging logging)
Parameter
NameDescription
loggingBucketInfo.Logging
Returns
TypeDescription
BucketInfo.Builder

setName(String name)

public abstract BucketInfo.Builder setName(String name)

Sets the bucket's name.

Parameter
NameDescription
nameString
Returns
TypeDescription
BucketInfo.Builder

setNotFoundPage(String notFoundPage)

public abstract BucketInfo.Builder setNotFoundPage(String notFoundPage)

Sets the custom object to return when a requested resource is not found.

Parameter
NameDescription
notFoundPageString
Returns
TypeDescription
BucketInfo.Builder

setRequesterPays(Boolean requesterPays)

public abstract BucketInfo.Builder setRequesterPays(Boolean requesterPays)

Sets whether a user accessing the bucket or an object it contains should assume the transit costs related to the access.

Parameter
NameDescription
requesterPaysBoolean
Returns
TypeDescription
BucketInfo.Builder

setRetentionPeriod(Long retentionPeriod) (deprecated)

public abstract BucketInfo.Builder setRetentionPeriod(Long retentionPeriod)

Deprecated. Use #setRetentionPeriodDuration(Duration)

If policy is not locked this value can be cleared, increased, and decreased. If policy is locked the retention period can only be increased.

Parameter
NameDescription
retentionPeriodLong
Returns
TypeDescription
BucketInfo.Builder

setRetentionPeriodDuration(Duration retentionPeriod)

public BucketInfo.Builder setRetentionPeriodDuration(Duration retentionPeriod)

If policy is not locked this value can be cleared, increased, and decreased. If policy is locked the retention period can only be increased.

Parameter
NameDescription
retentionPeriodDuration
Returns
TypeDescription
BucketInfo.Builder

setRpo(Rpo rpo)

public abstract BucketInfo.Builder setRpo(Rpo rpo)

Sets the bucket's Recovery Point Objective (RPO). This can only be set for a dual-region bucket, and determines the speed at which data will be replicated between regions. See the Rpo class for supported values, and here for additional details.

Parameter
NameDescription
rpoRpo
Returns
TypeDescription
BucketInfo.Builder

setStorageClass(StorageClass storageClass)

public abstract BucketInfo.Builder setStorageClass(StorageClass storageClass)

Sets the bucket's storage class. This defines how blobs in the bucket are stored and determines the SLA and the cost of storage. A list of supported values is available here.

Parameter
NameDescription
storageClassStorageClass
Returns
TypeDescription
BucketInfo.Builder

setVersioningEnabled(Boolean enable)

public abstract BucketInfo.Builder setVersioningEnabled(Boolean enable)

Sets whether versioning should be enabled for this bucket. When set to true, versioning is fully enabled.

Parameter
NameDescription
enableBoolean
Returns
TypeDescription
BucketInfo.Builder