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