Package com.google.cloud.storage
Class BucketInfo.Builder
java.lang.Object
com.google.cloud.storage.BucketInfo.Builder
- Direct Known Subclasses:
Bucket.Builder
- Enclosing class:
- BucketInfo
Builder for
BucketInfo
.-
Method Summary
Modifier and TypeMethodDescriptionabstract BucketInfo
build()
Creates aBucketInfo
object.abstract BucketInfo.Builder
Deletes the lifecycle rules of this bucket.abstract BucketInfo.Builder
Sets the bucket's access control configuration.abstract BucketInfo.Builder
setAutoclass
(BucketInfo.Autoclass autoclass) abstract BucketInfo.Builder
Sets the bucket's Cross-Origin Resource Sharing (CORS) configuration.abstract BucketInfo.Builder
setCustomPlacementConfig
(BucketInfo.CustomPlacementConfig customPlacementConfig) 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.abstract BucketInfo.Builder
setDefaultEventBasedHold
(Boolean defaultEventBasedHold) Sets the default event-based hold for this bucket.abstract BucketInfo.Builder
setDefaultKmsKeyName
(String defaultKmsKeyName) Sets the default Cloud KMS key name for this bucket.abstract BucketInfo.Builder
setDeleteRules
(Iterable<? extends BucketInfo.DeleteRule> rules) Deprecated.abstract BucketInfo.Builder
setIamConfiguration
(BucketInfo.IamConfiguration iamConfiguration) Sets the IamConfiguration to specify whether IAM access should be enabled.abstract BucketInfo.Builder
setIndexPage
(String indexPage) Sets the bucket's website index page.abstract BucketInfo.Builder
Sets the label of this bucket.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.abstract BucketInfo.Builder
setLocation
(String location) Sets the bucket's location.abstract BucketInfo.Builder
setLogging
(BucketInfo.Logging logging) abstract BucketInfo.Builder
Sets the bucket's name.abstract BucketInfo.Builder
setNotFoundPage
(String notFoundPage) Sets the custom object to return when a requested resource is not found.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.abstract BucketInfo.Builder
setRetentionPeriod
(Long retentionPeriod) Deprecated.setRetentionPeriodDuration
(Duration retentionPeriod) If policy is not locked this value can be cleared, increased, and decreased.abstract BucketInfo.Builder
Sets the bucket's Recovery Point Objective (RPO).abstract BucketInfo.Builder
setStorageClass
(StorageClass storageClass) Sets the bucket's storage class.abstract BucketInfo.Builder
setVersioningEnabled
(Boolean enable) Sets whether versioning should be enabled for this bucket.
-
Method Details
-
setName
Sets the bucket's name. -
setRequesterPays
Sets whether a user accessing the bucket or an object it contains should assume the transit costs related to the access. -
setVersioningEnabled
Sets whether versioning should be enabled for this bucket. When set to true, versioning is fully enabled. -
setIndexPage
Sets the bucket's website index page. Behaves as the bucket's directory index where missing blobs are treated as potential directories. -
setNotFoundPage
Sets the custom object to return when a requested resource is not found. -
setDeleteRules
@Deprecated public abstract BucketInfo.Builder setDeleteRules(Iterable<? extends BucketInfo.DeleteRule> rules) Deprecated.UsesetLifecycleRules(Iterable)
instead, as insetLifecycleRules(Collections.singletonList( new BucketInfo.LifecycleRule( LifecycleAction.newDeleteAction(), LifecycleCondition.newBuilder().setAge(5).build())));
Sets the bucket's lifecycle configuration as a number of delete rules. -
setLifecycleRules
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:
-
deleteLifecycleRules
Deletes the lifecycle rules of this bucket. -
setRpo
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 theRpo
class for supported values, and here for additional details. -
setStorageClass
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. -
setLocation
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. -
setCors
Sets the bucket's Cross-Origin Resource Sharing (CORS) configuration.- See Also:
-
setAcl
Sets the bucket's access control configuration.- See Also:
-
setDefaultAcl
Sets the default access control configuration to apply to bucket's blobs when no other configuration is specified.- See Also:
-
setLabels
public abstract BucketInfo.Builder setLabels(@Nullable Map<@NonNull String, @Nullable String> labels) Sets the label of this bucket. -
setDefaultKmsKeyName
Sets the default Cloud KMS key name for this bucket. -
setDefaultEventBasedHold
Sets the default event-based hold for this bucket. -
setRetentionPeriod
Deprecated.If policy is not locked this value can be cleared, increased, and decreased. If policy is locked the retention period can only be increased. -
setRetentionPeriodDuration
If policy is not locked this value can be cleared, increased, and decreased. If policy is locked the retention period can only be increased. -
setIamConfiguration
@BetaApi public abstract BucketInfo.Builder setIamConfiguration(BucketInfo.IamConfiguration iamConfiguration) Sets the IamConfiguration to specify whether IAM access should be enabled.- See Also:
-
setAutoclass
-
setLogging
-
setCustomPlacementConfig
public abstract BucketInfo.Builder setCustomPlacementConfig(BucketInfo.CustomPlacementConfig customPlacementConfig) -
build
Creates aBucketInfo
object.
-
setLifecycleRules(Iterable)
instead, as insetLifecycleRules(Collections.singletonList( new BucketInfo.LifecycleRule( LifecycleAction.newDeleteAction(), LifecycleCondition.newBuilder().setAge(5).build())));