public static class Bucket.Builder extends BucketInfo.Builder
Bucket
.Modifier and Type | Method and Description |
---|---|
Bucket |
build()
Creates a
BucketInfo object. |
Bucket.Builder |
deleteLifecycleRules()
Deletes the lifecycle rules of this bucket.
|
Bucket.Builder |
setAcl(Iterable<Acl> acl)
Sets the bucket's access control configuration.
|
Bucket.Builder |
setAutoclass(BucketInfo.Autoclass autoclass) |
Bucket.Builder |
setCors(Iterable<Cors> cors)
Sets the bucket's Cross-Origin Resource Sharing (CORS) configuration.
|
Bucket.Builder |
setCustomPlacementConfig(BucketInfo.CustomPlacementConfig customPlacementConfig) |
Bucket.Builder |
setDefaultAcl(Iterable<Acl> acl)
Sets the default access control configuration to apply to bucket's blobs when no other
configuration is specified.
|
Bucket.Builder |
setDefaultEventBasedHold(Boolean defaultEventBasedHold)
Sets the default event-based hold for this bucket.
|
Bucket.Builder |
setDefaultKmsKeyName(String defaultKmsKeyName)
Sets the default Cloud KMS key name for this bucket.
|
Bucket.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()))); |
Bucket.Builder |
setIamConfiguration(BucketInfo.IamConfiguration iamConfiguration)
Sets the IamConfiguration to specify whether IAM access should be enabled.
|
Bucket.Builder |
setIndexPage(String indexPage)
Sets the bucket's website index page.
|
Bucket.Builder |
setLabels(@Nullable Map<String,String> labels)
Sets the label of this bucket.
|
Bucket.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.
|
Bucket.Builder |
setLocation(String location)
Sets the bucket's location.
|
Bucket.Builder |
setLogging(BucketInfo.Logging logging) |
Bucket.Builder |
setName(String name)
Sets the bucket's name.
|
Bucket.Builder |
setNotFoundPage(String notFoundPage)
Sets the custom object to return when a requested resource is not found.
|
Bucket.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.
|
Bucket.Builder |
setRetentionPeriod(Long retentionPeriod)
Deprecated.
|
BucketInfo.Builder |
setRetentionPeriodDuration(Duration retentionPeriod)
If policy is not locked this value can be cleared, increased, and decreased.
|
Bucket.Builder |
setRpo(Rpo rpo)
Sets the bucket's Recovery Point Objective (RPO).
|
Bucket.Builder |
setStorageClass(StorageClass storageClass)
Sets the bucket's storage class.
|
Bucket.Builder |
setVersioningEnabled(Boolean enable)
Sets whether versioning should be enabled for this bucket.
|
public Bucket.Builder setName(String name)
BucketInfo.Builder
setName
in class BucketInfo.Builder
public Bucket.Builder setVersioningEnabled(Boolean enable)
BucketInfo.Builder
setVersioningEnabled
in class BucketInfo.Builder
public Bucket.Builder setRequesterPays(Boolean requesterPays)
BucketInfo.Builder
setRequesterPays
in class BucketInfo.Builder
public Bucket.Builder setIndexPage(String indexPage)
BucketInfo.Builder
setIndexPage
in class BucketInfo.Builder
public Bucket.Builder setNotFoundPage(String notFoundPage)
BucketInfo.Builder
setNotFoundPage
in class BucketInfo.Builder
@Deprecated public Bucket.Builder setDeleteRules(Iterable<? extends BucketInfo.DeleteRule> rules)
setLifecycleRules(Iterable)
instead, as in setLifecycleRules(Collections.singletonList( new BucketInfo.LifecycleRule(
LifecycleAction.newDeleteAction(), LifecycleCondition.newBuilder().setAge(5).build())));
BucketInfo.Builder
setDeleteRules
in class BucketInfo.Builder
public Bucket.Builder setLifecycleRules(Iterable<? extends BucketInfo.LifecycleRule> rules)
BucketInfo.Builder
setLifecycleRules
in class BucketInfo.Builder
public Bucket.Builder deleteLifecycleRules()
BucketInfo.Builder
deleteLifecycleRules
in class BucketInfo.Builder
public Bucket.Builder setRpo(Rpo rpo)
BucketInfo.Builder
Rpo
class for supported values, and here for additional
details.setRpo
in class BucketInfo.Builder
public Bucket.Builder setStorageClass(StorageClass storageClass)
BucketInfo.Builder
setStorageClass
in class BucketInfo.Builder
public Bucket.Builder setLocation(String location)
BucketInfo.Builder
setLocation
in class BucketInfo.Builder
public Bucket.Builder setCors(Iterable<Cors> cors)
BucketInfo.Builder
setCors
in class BucketInfo.Builder
public Bucket.Builder setAcl(Iterable<Acl> acl)
BucketInfo.Builder
setAcl
in class BucketInfo.Builder
public Bucket.Builder setDefaultAcl(Iterable<Acl> acl)
BucketInfo.Builder
setDefaultAcl
in class BucketInfo.Builder
public Bucket.Builder setLabels(@Nullable Map<String,String> labels)
BucketInfo.Builder
setLabels
in class BucketInfo.Builder
public Bucket.Builder setDefaultKmsKeyName(String defaultKmsKeyName)
BucketInfo.Builder
setDefaultKmsKeyName
in class BucketInfo.Builder
public Bucket.Builder setDefaultEventBasedHold(Boolean defaultEventBasedHold)
BucketInfo.Builder
setDefaultEventBasedHold
in class BucketInfo.Builder
@Deprecated public Bucket.Builder setRetentionPeriod(Long retentionPeriod)
setRetentionPeriodDuration(Duration)
BucketInfo.Builder
setRetentionPeriod
in class BucketInfo.Builder
public BucketInfo.Builder setRetentionPeriodDuration(Duration retentionPeriod)
BucketInfo.Builder
setRetentionPeriodDuration
in class BucketInfo.Builder
public Bucket.Builder setIamConfiguration(BucketInfo.IamConfiguration iamConfiguration)
BucketInfo.Builder
setIamConfiguration
in class BucketInfo.Builder
public Bucket.Builder setAutoclass(BucketInfo.Autoclass autoclass)
setAutoclass
in class BucketInfo.Builder
public Bucket.Builder setLogging(BucketInfo.Logging logging)
setLogging
in class BucketInfo.Builder
public Bucket.Builder setCustomPlacementConfig(BucketInfo.CustomPlacementConfig customPlacementConfig)
setCustomPlacementConfig
in class BucketInfo.Builder
public Bucket build()
BucketInfo.Builder
BucketInfo
object.build
in class BucketInfo.Builder
Copyright © 2023 Google LLC. All rights reserved.