public static class Bucket.Builder extends BucketInfo.Builder
Builder for Bucket
.
Methods
build()
public Bucket build()
Creates a BucketInfo
object.
Type | Description |
Bucket |
deleteLifecycleRules()
public Bucket.Builder deleteLifecycleRules()
Deletes the lifecycle rules of this bucket.
Type | Description |
Bucket.Builder |
setAcl(Iterable<Acl> acl)
public Bucket.Builder setAcl(Iterable<Acl> acl)
Sets the bucket's access control configuration.
Name | Description |
acl | Iterable<Acl> |
Type | Description |
Bucket.Builder |
setCors(Iterable<Cors> cors)
public Bucket.Builder setCors(Iterable<Cors> cors)
Sets the bucket's Cross-Origin Resource Sharing (CORS) configuration.
Name | Description |
cors | Iterable<Cors> |
Type | Description |
Bucket.Builder |
setCustomPlacementConfig(BucketInfo.CustomPlacementConfig customPlacementConfig)
public Bucket.Builder setCustomPlacementConfig(BucketInfo.CustomPlacementConfig customPlacementConfig)
Name | Description |
customPlacementConfig | BucketInfo.CustomPlacementConfig |
Type | Description |
Bucket.Builder |
setDefaultAcl(Iterable<Acl> acl)
public Bucket.Builder setDefaultAcl(Iterable<Acl> acl)
Sets the default access control configuration to apply to bucket's blobs when no other configuration is specified.
Name | Description |
acl | Iterable<Acl> |
Type | Description |
Bucket.Builder |
setDefaultEventBasedHold(Boolean defaultEventBasedHold)
public Bucket.Builder setDefaultEventBasedHold(Boolean defaultEventBasedHold)
Sets the default event-based hold for this bucket.
Name | Description |
defaultEventBasedHold | Boolean |
Type | Description |
Bucket.Builder |
setDefaultKmsKeyName(String defaultKmsKeyName)
public Bucket.Builder setDefaultKmsKeyName(String defaultKmsKeyName)
Sets the default Cloud KMS key name for this bucket.
Name | Description |
defaultKmsKeyName | String |
Type | Description |
Bucket.Builder |
setDeleteRules(Iterable<? extends BucketInfo.DeleteRule> rules)
public Bucket.Builder setDeleteRules(Iterable<? extends BucketInfo.DeleteRule> rules)
Sets the bucket's lifecycle configuration as a number of delete rules.
Name | Description |
rules | Iterable<? extends com.google.cloud.storage.BucketInfo.DeleteRule> |
Type | Description |
Bucket.Builder |
setIamConfiguration(BucketInfo.IamConfiguration iamConfiguration)
public Bucket.Builder setIamConfiguration(BucketInfo.IamConfiguration iamConfiguration)
Sets the IamConfiguration to specify whether IAM access should be enabled.
Name | Description |
iamConfiguration | BucketInfo.IamConfiguration |
Type | Description |
Bucket.Builder |
setIndexPage(String indexPage)
public Bucket.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.
Name | Description |
indexPage | String |
Type | Description |
Bucket.Builder |
setLabels(Map<String,String> labels)
public Bucket.Builder setLabels(Map<String,String> labels)
Sets the label of this bucket.
Name | Description |
labels | Map<String,String> |
Type | Description |
Bucket.Builder |
setLifecycleRules(Iterable<? extends BucketInfo.LifecycleRule> rules)
public 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.
Name | Description |
rules | Iterable<? extends com.google.cloud.storage.BucketInfo.LifecycleRule> |
Type | Description |
Bucket.Builder |
setLocation(String location)
public Bucket.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.
Name | Description |
location | String |
Type | Description |
Bucket.Builder |
setLogging(BucketInfo.Logging logging)
public Bucket.Builder setLogging(BucketInfo.Logging logging)
Name | Description |
logging | BucketInfo.Logging |
Type | Description |
Bucket.Builder |
setName(String name)
public Bucket.Builder setName(String name)
Sets the bucket's name.
Name | Description |
name | String |
Type | Description |
Bucket.Builder |
setNotFoundPage(String notFoundPage)
public Bucket.Builder setNotFoundPage(String notFoundPage)
Sets the custom object to return when a requested resource is not found.
Name | Description |
notFoundPage | String |
Type | Description |
Bucket.Builder |
setRequesterPays(Boolean requesterPays)
public 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.
Name | Description |
requesterPays | Boolean |
Type | Description |
Bucket.Builder |
setRetentionPeriod(Long retentionPeriod)
public Bucket.Builder setRetentionPeriod(Long 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.
Name | Description |
retentionPeriod | Long |
Type | Description |
Bucket.Builder |
setRpo(Rpo rpo)
public Bucket.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.
Name | Description |
rpo | Rpo |
Type | Description |
Bucket.Builder |
setStorageClass(StorageClass storageClass)
public Bucket.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.
Name | Description |
storageClass | StorageClass |
Type | Description |
Bucket.Builder |
setVersioningEnabled(Boolean enable)
public Bucket.Builder setVersioningEnabled(Boolean enable)
Sets whether versioning should be enabled for this bucket. When set to true, versioning is fully enabled.
Name | Description |
enable | Boolean |
Type | Description |
Bucket.Builder |