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 aBucketInfoobject.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.setCustomerManagedEncryptionEnforcementConfig(BucketInfo.CustomerManagedEncryptionEnforcementConfig customerManagedEncryptionEnforcementConfig) setCustomerSuppliedEncryptionEnforcementConfig(BucketInfo.CustomerSuppliedEncryptionEnforcementConfig customerSuppliedEncryptionEnforcementConfig) 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.setGoogleManagedEncryptionEnforcementConfig(BucketInfo.GoogleManagedEncryptionEnforcementConfig googleManagedEncryptionEnforcementConfig) setHierarchicalNamespace(BucketInfo.HierarchicalNamespace hierarchicalNamespace) 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.setIpFilter(BucketInfo.IpFilter ipFilter) 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).setSoftDeletePolicy(BucketInfo.SoftDeletePolicy softDeletePolicy) 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.BuilderSets the bucket's name.- Specified by:
setNamein classBucketInfo.Builder
-
setVersioningEnabled
Description copied from class:BucketInfo.BuilderSets whether versioning should be enabled for this bucket. When set to true, versioning is fully enabled.- Specified by:
setVersioningEnabledin classBucketInfo.Builder
-
setRequesterPays
Description copied from class:BucketInfo.BuilderSets whether a user accessing the bucket or an object it contains should assume the transit costs related to the access.- Specified by:
setRequesterPaysin classBucketInfo.Builder
-
setIndexPage
Description copied from class:BucketInfo.BuilderSets the bucket's website index page. Behaves as the bucket's directory index where missing blobs are treated as potential directories.- Specified by:
setIndexPagein classBucketInfo.Builder
-
setNotFoundPage
Description copied from class:BucketInfo.BuilderSets the custom object to return when a requested resource is not found.- Specified by:
setNotFoundPagein 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.BuilderSets the bucket's lifecycle configuration as a number of delete rules.- Specified by:
setDeleteRulesin classBucketInfo.Builder
-
setLifecycleRules
Description copied from class:BucketInfo.BuilderSets the bucket's lifecycle configuration as a number of lifecycle rules, consisting of an action and a condition.- Specified by:
setLifecycleRulesin classBucketInfo.Builder- See Also:
-
deleteLifecycleRules
Description copied from class:BucketInfo.BuilderDeletes the lifecycle rules of this bucket.- Specified by:
deleteLifecycleRulesin classBucketInfo.Builder
-
setRpo
Description copied from class:BucketInfo.BuilderSets 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 theRpoclass for supported values, and here for additional details.- Specified by:
setRpoin classBucketInfo.Builder
-
setStorageClass
Description copied from class:BucketInfo.BuilderSets 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:
setStorageClassin classBucketInfo.Builder
-
setLocation
Description copied from class:BucketInfo.BuilderSets 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:
setLocationin classBucketInfo.Builder
-
setCors
Description copied from class:BucketInfo.BuilderSets the bucket's Cross-Origin Resource Sharing (CORS) configuration.- Specified by:
setCorsin classBucketInfo.Builder- See Also:
-
setAcl
Description copied from class:BucketInfo.BuilderSets the bucket's access control configuration.- Specified by:
setAclin classBucketInfo.Builder- See Also:
-
setDefaultAcl
Description copied from class:BucketInfo.BuilderSets the default access control configuration to apply to bucket's blobs when no other configuration is specified.- Specified by:
setDefaultAclin classBucketInfo.Builder- See Also:
-
setLabels
Description copied from class:BucketInfo.BuilderSets the label of this bucket.- Specified by:
setLabelsin classBucketInfo.Builder
-
setDefaultKmsKeyName
Description copied from class:BucketInfo.BuilderSets the default Cloud KMS key name for this bucket.- Specified by:
setDefaultKmsKeyNamein classBucketInfo.Builder
-
setDefaultEventBasedHold
Description copied from class:BucketInfo.BuilderSets the default event-based hold for this bucket.- Specified by:
setDefaultEventBasedHoldin classBucketInfo.Builder
-
setRetentionPeriod
Deprecated.Description copied from class:BucketInfo.BuilderIf 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:
setRetentionPeriodin classBucketInfo.Builder
-
setRetentionPeriodDuration
Description copied from class:BucketInfo.BuilderIf policy is not locked this value can be cleared, increased, and decreased. If policy is locked the retention period can only be increased.- Overrides:
setRetentionPeriodDurationin classBucketInfo.Builder
-
setIamConfiguration
Description copied from class:BucketInfo.BuilderSets the IamConfiguration to specify whether IAM access should be enabled.- Specified by:
setIamConfigurationin classBucketInfo.Builder- See Also:
-
setAutoclass
- Specified by:
setAutoclassin classBucketInfo.Builder
-
setLogging
- Specified by:
setLoggingin classBucketInfo.Builder
-
setCustomPlacementConfig
public Bucket.Builder setCustomPlacementConfig(BucketInfo.CustomPlacementConfig customPlacementConfig) - Specified by:
setCustomPlacementConfigin classBucketInfo.Builder
-
setSoftDeletePolicy
- Specified by:
setSoftDeletePolicyin classBucketInfo.Builder
-
setHierarchicalNamespace
public Bucket.Builder setHierarchicalNamespace(BucketInfo.HierarchicalNamespace hierarchicalNamespace) - Specified by:
setHierarchicalNamespacein classBucketInfo.Builder
-
setIpFilter
- Specified by:
setIpFilterin classBucketInfo.Builder
-
setGoogleManagedEncryptionEnforcementConfig
public Bucket.Builder setGoogleManagedEncryptionEnforcementConfig(BucketInfo.GoogleManagedEncryptionEnforcementConfig googleManagedEncryptionEnforcementConfig) - Specified by:
setGoogleManagedEncryptionEnforcementConfigin classBucketInfo.Builder
-
setCustomerManagedEncryptionEnforcementConfig
public Bucket.Builder setCustomerManagedEncryptionEnforcementConfig(BucketInfo.CustomerManagedEncryptionEnforcementConfig customerManagedEncryptionEnforcementConfig) - Specified by:
setCustomerManagedEncryptionEnforcementConfigin classBucketInfo.Builder
-
setCustomerSuppliedEncryptionEnforcementConfig
public Bucket.Builder setCustomerSuppliedEncryptionEnforcementConfig(BucketInfo.CustomerSuppliedEncryptionEnforcementConfig customerSuppliedEncryptionEnforcementConfig) - Specified by:
setCustomerSuppliedEncryptionEnforcementConfigin classBucketInfo.Builder
-
build
Description copied from class:BucketInfo.BuilderCreates aBucketInfoobject.- Specified by:
buildin classBucketInfo.Builder
-
clearGoogleManagedEncryptionEnforcementConfig
-
clearCustomerManagedEncryptionEnforcementConfig
-
clearCustomerSuppliedEncryptionEnforcementConfig
-
setLifecycleRules(Iterable)instead, as insetLifecycleRules(Collections.singletonList( new BucketInfo.LifecycleRule( LifecycleAction.newDeleteAction(), LifecycleCondition.newBuilder().setAge(5).build())));