Send feedback
Class BucketInfo.Builder (2.1.10)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.1.10 keyboard_arrow_down
public abstract static class BucketInfo . Builder
Methods
build()
public abstract BucketInfo build ()
Creates a BucketInfo
object.
Returns
deleteLifecycleRules()
public abstract BucketInfo . Builder deleteLifecycleRules ()
Deletes the lifecycle rules of this bucket.
Returns
setAcl(Iterable<Acl> acl)
public abstract BucketInfo . Builder setAcl ( Iterable<Acl> acl )
Sets the bucket's access control configuration.
Parameter
Returns
setCors(Iterable<Cors> cors)
public abstract BucketInfo . Builder setCors ( Iterable<Cors> cors )
Sets the bucket's Cross-Origin Resource Sharing (CORS) configuration.
Parameter
Returns
setDefaultAcl(Iterable<Acl> acl)
public 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.
Parameter
Returns
setDefaultEventBasedHold(Boolean defaultEventBasedHold)
public abstract BucketInfo . Builder setDefaultEventBasedHold ( Boolean defaultEventBasedHold )
Sets the default event-based hold for this bucket.
Parameter
Name
Description
defaultEventBasedHold
Boolean
Returns
setDefaultKmsKeyName(String defaultKmsKeyName)
public abstract BucketInfo . Builder setDefaultKmsKeyName ( String defaultKmsKeyName )
Sets the default Cloud KMS key name for this bucket.
Parameter
Name
Description
defaultKmsKeyName
String
Returns
setDeleteRules(Iterable<? extends BucketInfo.DeleteRule> rules) (deprecated)
public abstract BucketInfo . Builder setDeleteRules ( Iterable <? extends BucketInfo . DeleteRule > rules )
(deprecated) Use setLifecycleRules
instead, as in
setLifecycleRules(Collections.singletonList( new BucketInfo.LifecycleRule(
LifecycleAction.newDeleteAction(), LifecycleCondition.newBuilder().setAge(5).build())));
Sets the bucket's lifecycle configuration as a number of delete rules.
Parameter
Name
Description
rules
Iterable <? extends com.google.cloud.storage.BucketInfo.DeleteRule >
Returns
setIamConfiguration(BucketInfo.IamConfiguration iamConfiguration)
public abstract BucketInfo . Builder setIamConfiguration ( BucketInfo . IamConfiguration iamConfiguration )
Sets the IamConfiguration to specify whether IAM access should be enabled.
Parameter
Returns
setIndexPage(String indexPage)
public abstract BucketInfo . 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.
Parameter
Name
Description
indexPage
String
Returns
setLabels(Map<String,String> labels)
public abstract BucketInfo . Builder setLabels ( Map<String , String > labels )
Sets the label of this bucket.
Parameter
Returns
setLifecycleRules(Iterable<? extends BucketInfo.LifecycleRule> rules)
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.
Parameter
Name
Description
rules
Iterable <? extends com.google.cloud.storage.BucketInfo.LifecycleRule >
Returns
setLocation(String location)
public abstract BucketInfo . Builder setLocation ( String location )
Sets the bucket's location. Data for blobs in the bucket resides in physical storage within
this region. A list of supported values is available here .
Parameter
Name
Description
location
String
Returns
setLogging(BucketInfo.Logging logging)
public abstract BucketInfo . Builder setLogging ( BucketInfo . Logging logging )
Parameter
Returns
setName(String name)
public abstract BucketInfo . Builder setName ( String name )
Parameter
Returns
setNotFoundPage(String notFoundPage)
public abstract BucketInfo . Builder setNotFoundPage ( String notFoundPage )
Sets the custom object to return when a requested resource is not found.
Parameter
Name
Description
notFoundPage
String
Returns
setRequesterPays(Boolean requesterPays)
public 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.
Parameter
Name
Description
requesterPays
Boolean
Returns
setRetentionPeriod(Long retentionPeriod)
public abstract BucketInfo . 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.
Parameter
Name
Description
retentionPeriod
Long
Returns
setStorageClass(StorageClass storageClass)
public abstract BucketInfo . 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 .
Parameter
Returns
setVersioningEnabled(Boolean enable)
public abstract BucketInfo . Builder setVersioningEnabled ( Boolean enable )
Sets whether versioning should be enabled for this bucket. When set to true, versioning is
fully enabled.
Parameter
Returns
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-11-01 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-01 UTC."],[],[]]