Package com.google.cloud.storage (2.40.0)

GitHub Repository

Classes

Class Description
com.google.cloud.storage.Acl Access Control List for buckets or blobs. See Also: About Access Control Lists
com.google.cloud.storage.Acl.Builder Builder for Acl objects.
com.google.cloud.storage.Acl.Domain Class for ACL Domain entities.
com.google.cloud.storage.Acl.Entity Base class for Access Control List entities.
com.google.cloud.storage.Acl.Group Class for ACL Group entities.
com.google.cloud.storage.Acl.Project Class for ACL Project entities.
com.google.cloud.storage.Acl.Project.ProjectRole
com.google.cloud.storage.Acl.RawEntity
com.google.cloud.storage.Acl.Role
com.google.cloud.storage.Acl.User Class for ACL User entities.
com.google.cloud.storage.BidiBlobWriteSessionConfig Perform a resumable upload, uploading at most bufferSize bytes each flush.

Configuration of buffer size can be performed via BidiBlobWriteSessionConfig#withBufferSize(int).

com.google.cloud.storage.Blob An object in Google Cloud Storage. A Blob object includes the BlobId instance, the set of properties inherited from the BlobInfo class and the Storage instance. The class provides methods to perform operations on the object. Reading a property value does not issue any RPC calls. The object content is not stored within the Blob instance.
com.google.cloud.storage.Blob.BlobSourceOption Class for specifying blob source options when Blob methods are used.
com.google.cloud.storage.Blob.Builder Builder for Blob.
com.google.cloud.storage.BlobId Google Storage Object identifier. A BlobId object includes the name of the containing bucket, the blob's name and possibly the blob's generation. If #getGeneration() is null the identifier refers to the latest blob's generation.
com.google.cloud.storage.BlobInfo Information about an object in Google Cloud Storage. A BlobInfo object includes the BlobId instance and the set of properties, such as the blob's access control configuration, user provided metadata, the CRC32C checksum, etc. Instances of this class are used to create a new object in Google Cloud Storage or update the properties of an existing object. To
com.google.cloud.storage.BlobInfo.Builder Builder for BlobInfo.
com.google.cloud.storage.BlobInfo.CustomerEncryption Objects of this class hold information on the customer-supplied encryption key, if the blob is encrypted using such a key.
com.google.cloud.storage.BlobInfo.ImmutableEmptyMap This class is meant for internal use only. Users are discouraged from using this class.
com.google.cloud.storage.BlobInfo.Retention Defines a blob's Retention policy. Can only be used on objects in a retention-enabled bucket.
com.google.cloud.storage.BlobInfo.Retention.Builder
com.google.cloud.storage.BlobInfo.Retention.Mode
com.google.cloud.storage.BlobWriteSessionConfig A sealed internal implementation only class which provides the means of configuring a BlobWriteSession.

A BlobWriteSessionConfig will be used to configure all BlobWriteSessions produced by an instance of Storage.

com.google.cloud.storage.BlobWriteSessionConfigs Factory class to select and construct BlobWriteSessionConfigs.

There are several strategies which can be used to upload a Blob to Google Cloud Storage. This class provides factories which allow you to select the appropriate strategy for

com.google.cloud.storage.Bucket A Google cloud storage bucket.

Objects of this class are immutable. Operations that modify the bucket like #update return a new object. To get a Bucket object with the most recent information use #reload. Bucket adds a layer of service-related functionality over BucketInfo.

com.google.cloud.storage.Bucket.BlobTargetOption Class for specifying blob target options when Bucket methods are used.
com.google.cloud.storage.Bucket.BlobWriteOption Class for specifying blob write options when Bucket methods are used.
com.google.cloud.storage.Bucket.BucketSourceOption Class for specifying bucket source options when Bucket methods are used.
com.google.cloud.storage.Bucket.Builder Builder for Bucket.
com.google.cloud.storage.BucketInfo Google Storage bucket metadata; See Also: Concepts and Terminology
com.google.cloud.storage.BucketInfo.AgeDeleteRule Deprecated. Use a LifecycleRule with a DeleteLifecycleAction and use LifecycleCondition.Builder.setAge instead.

For example, new DeleteLifecycleAction(1) is equivalent to new

com.google.cloud.storage.BucketInfo.Autoclass Configuration for the Autoclass settings of a bucket. See Also: https://cloud.google.com/storage/docs/autoclass
com.google.cloud.storage.BucketInfo.Autoclass.Builder
com.google.cloud.storage.BucketInfo.Builder Builder for BucketInfo.
com.google.cloud.storage.BucketInfo.CreatedBeforeDeleteRule Deprecated. Use a LifecycleRule with an action DeleteLifecycleAction and a condition LifecycleCondition.Builder.setCreatedBefore instead.
com.google.cloud.storage.BucketInfo.CustomPlacementConfig The bucket's custom placement configuration for Custom Dual Regions. If using location is also required.
com.google.cloud.storage.BucketInfo.CustomPlacementConfig.Builder
com.google.cloud.storage.BucketInfo.DeleteRule Deprecated. Use a LifecycleRule with a DeleteLifecycleAction and a LifecycleCondition which is equivalent to a subclass of DeleteRule instead.
com.google.cloud.storage.BucketInfo.HierarchicalNamespace The bucket's hierarchical namespace (Folders) configuration. Enable this to use HNS.
com.google.cloud.storage.BucketInfo.HierarchicalNamespace.Builder
com.google.cloud.storage.BucketInfo.IamConfiguration The Bucket's IAM Configuration. See Also: public-access-prevention, uniform bucket-level access
com.google.cloud.storage.BucketInfo.IamConfiguration.Builder Builder for IamConfiguration
com.google.cloud.storage.BucketInfo.IsLiveDeleteRule Deprecated. Use a LifecycleRule with a DeleteLifecycleAction and a condition LifecycleCondition.Builder.setIsLive instead.
com.google.cloud.storage.BucketInfo.LifecycleRule Lifecycle rule for a bucket. Allows supported Actions, such as deleting and changing storage class, to be executed when certain Conditions are met.

Versions 1.50.0-1.111.2 of this library don’t support the CustomTimeBefore,

com.google.cloud.storage.BucketInfo.LifecycleRule.AbortIncompleteMPUAction
com.google.cloud.storage.BucketInfo.LifecycleRule.DeleteLifecycleAction
com.google.cloud.storage.BucketInfo.LifecycleRule.LifecycleAction Base class for the Action to take when a Lifecycle Condition is met. Supported Actions are expressed as subclasses of this class, accessed by static factory methods.
com.google.cloud.storage.BucketInfo.LifecycleRule.LifecycleCondition Condition for a Lifecycle rule, specifies under what criteria an Action should be executed. See Also: Object Lifecycle Management
com.google.cloud.storage.BucketInfo.LifecycleRule.LifecycleCondition.Builder Builder for LifecycleCondition.
com.google.cloud.storage.BucketInfo.LifecycleRule.SetStorageClassLifecycleAction
com.google.cloud.storage.BucketInfo.Logging The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs.
com.google.cloud.storage.BucketInfo.Logging.Builder
com.google.cloud.storage.BucketInfo.NumNewerVersionsDeleteRule Deprecated. Use a LifecycleRule with a DeleteLifecycleAction and a condition LifecycleCondition.Builder.setNumberOfNewerVersions instead.
com.google.cloud.storage.BucketInfo.ObjectRetention
com.google.cloud.storage.BucketInfo.ObjectRetention.Builder
com.google.cloud.storage.BucketInfo.ObjectRetention.Mode
com.google.cloud.storage.BucketInfo.SoftDeletePolicy The bucket's soft delete policy. If this policy is set, any deleted objects will be soft-deleted according to the time specified in the policy
com.google.cloud.storage.BucketInfo.SoftDeletePolicy.Builder
com.google.cloud.storage.BufferToDiskThenUpload There are scenarios in which disk space is more plentiful than memory space. This new BlobWriteSessionConfig allows augmenting an instance of storage to produce BlobWriteSessions which will buffer to disk rather than holding things in memory.

Once the file on disk is closed, the entire file will then be uploaded to GCS. See Also: BlobWriteSessionConfigs#bufferToDiskThenUpload(Path), Storage#blobWriteSession(BlobInfo, BlobWriteOption...), BlobWriteSessionConfigs#bufferToDiskThenUpload(Collection), GrpcStorageOptions.Builder#setBlobWriteSessionConfig(BlobWriteSessionConfig)

com.google.cloud.storage.CanonicalExtensionHeadersSerializer Canonical extension header serializer. See Also: Canonical Extension Headers
com.google.cloud.storage.CopyWriter Google Storage blob copy writer. A CopyWriter object allows to copy both blob's data and information. To override source blob's information supply a BlobInfo to the CopyRequest using either Storage.CopyRequest.Builder#setTarget(BlobInfo,
com.google.cloud.storage.Cors Cross-Origin Resource Sharing (CORS) configuration for a bucket. See Also: Cross-Origin Resource Sharing (CORS)
com.google.cloud.storage.Cors.Builder CORS configuration builder.
com.google.cloud.storage.Cors.Origin Class for a CORS origin.
com.google.cloud.storage.DefaultBlobWriteSessionConfig Default Configuration to represent uploading to Google Cloud Storage in a chunked manner.

Perform a resumable upload, uploading at most chunkSize bytes each PUT.

com.google.cloud.storage.GrpcStorageOptions
com.google.cloud.storage.GrpcStorageOptions.Builder
com.google.cloud.storage.GrpcStorageOptions.GrpcStorageDefaults
com.google.cloud.storage.GrpcStorageOptions.GrpcStorageFactory Internal implementation detail, only public to allow for java.io.Serializable compatibility in com.google.cloud.ServiceOptions.

To access an instance of this class instead use GrpcStorageOptions.defaults().getDefaultServiceFactory().

com.google.cloud.storage.GrpcStorageOptions.GrpcStorageRpcFactory Internal implementation detail, only public to allow for java.io.Serializable compatibility in com.google.cloud.ServiceOptions.

To access an instance of this class instead use GrpcStorageOptions.defaults().getDefaultRpcFactory().

com.google.cloud.storage.HmacKey HMAC key for a service account.
com.google.cloud.storage.HmacKey.Builder Builder for HmacKey objects. *
com.google.cloud.storage.HmacKey.HmacKeyMetadata The metadata for a service account HMAC key. This class holds all data associated with an HMAC key other than the secret key.
com.google.cloud.storage.HmacKey.HmacKeyMetadata.Builder Builder for HmacKeyMetadata objects. *
com.google.cloud.storage.HttpCopyWriter
com.google.cloud.storage.HttpMethod Http method supported by Storage service.
com.google.cloud.storage.HttpStorageOptions
com.google.cloud.storage.HttpStorageOptions.Builder
com.google.cloud.storage.HttpStorageOptions.HttpStorageDefaults
com.google.cloud.storage.HttpStorageOptions.HttpStorageFactory Internal implementation detail, only public to allow for java.io.Serializable.

To access an instance of this class instead use HttpStorageOptions.defaults().getDefaultServiceFactory(). See Also: HttpStorageOptions#defaults(), HttpStorageDefaults#getDefaultServiceFactory()

com.google.cloud.storage.HttpStorageOptions.HttpStorageRpcFactory Internal implementation detail, only public to allow for java.io.Serializable.

To access an instance of this class instead use HttpStorageOptions.defaults().getDefaultRpcFactory(). See Also: HttpStorageDefaults#getDefaultRpcFactory(), HttpStorageOptions#defaults()

com.google.cloud.storage.JournalingBlobWriteSessionConfig There are scenarios in which disk space is more plentiful than memory space. This new BlobWriteSessionConfig allows augmenting an instance of storage to produce BlobWriteSessions which will buffer to disk rather than holding things in memory.

If we have disk available we can checkpoint the contents of an object to disk before transmitting to GCS. The checkpointed data on disk allows arbitrary rewind in the case of failure

com.google.cloud.storage.Notification The class representing Pub/Sub notifications for the Storage. See pubsub-notifications for details.
com.google.cloud.storage.Notification.Builder Builder for Notification.
com.google.cloud.storage.NotificationInfo The class representing Pub/Sub Notification metadata for the Storage.
com.google.cloud.storage.NotificationInfo.Builder Builder for NotificationInfo.
com.google.cloud.storage.NotificationInfo.BuilderImpl Builder for NotificationInfo.
com.google.cloud.storage.Option Base class for Storage operation option.
com.google.cloud.storage.ParallelCompositeUploadBlobWriteSessionConfig Immutable config builder to configure BlobWriteSession instances to perform Parallel Composite Uploads.

Parallel Composite Uploads can yield higher throughput when uploading large objects. However,

com.google.cloud.storage.ParallelCompositeUploadBlobWriteSessionConfig.BufferAllocationStrategy A strategy which dictates how buffers are to be used for individual parts. The chosen strategy will apply to all instances of BlobWriteSession created from a single instance of Storage. See Also: #withBufferAllocationStrategy(BufferAllocationStrategy)
com.google.cloud.storage.ParallelCompositeUploadBlobWriteSessionConfig.ExecutorSupplier Class which will be used to supply an Executor where work will be submitted when performing a parallel composite upload. See Also: #withExecutorSupplier(ExecutorSupplier)
com.google.cloud.storage.ParallelCompositeUploadBlobWriteSessionConfig.PartCleanupStrategy A cleanup strategy which will dictate what cleanup operations are performed automatically when performing a parallel composite upload. See Also: #withPartCleanupStrategy(PartCleanupStrategy)
com.google.cloud.storage.ParallelCompositeUploadBlobWriteSessionConfig.PartMetadataFieldDecorator A Decorator which is used to manipulate metadata fields, specifically on the part objects created in a Parallel Composite Upload See Also: #withPartMetadataFieldDecorator(PartMetadataFieldDecorator)
com.google.cloud.storage.ParallelCompositeUploadBlobWriteSessionConfig.PartNamingStrategy A naming strategy which will be used to generate a name for a part or intermediary compose object. See Also: #withPartNamingStrategy(PartNamingStrategy)
com.google.cloud.storage.PostPolicyV4 Presigned V4 post policy. Instances of PostPolicyV4 include a URL and a map of fields that can be specified in an HTML form to submit a POST request to upload an object.

See POST Object for

com.google.cloud.storage.PostPolicyV4.ConditionV4 Class for a specific POST policy document condition. See Also: Policy document
com.google.cloud.storage.PostPolicyV4.PostConditionsV4 A helper class for specifying conditions in a V4 POST Policy document. Used in: Storage#generateSignedPostPolicyV4(BlobInfo, long, TimeUnit, PostPolicyV4.PostFieldsV4, PostPolicyV4.PostConditionsV4, Storage.PostPolicyV4Option...). See Also: Policy document
com.google.cloud.storage.PostPolicyV4.PostConditionsV4.Builder
com.google.cloud.storage.PostPolicyV4.PostFieldsV4 A helper class to define fields to be specified in a V4 POST request. Instance of this class helps to construct PostPolicyV4 objects. Used in: Storage#generateSignedPostPolicyV4(BlobInfo, long, TimeUnit, PostPolicyV4.PostFieldsV4, PostPolicyV4.PostConditionsV4, Storage.PostPolicyV4Option...).
com.google.cloud.storage.PostPolicyV4.PostFieldsV4.Builder
com.google.cloud.storage.PostPolicyV4.PostPolicyV4Document Class for a V4 POST Policy document. Used by Storage to construct PostPolicyV4 objects. See Also: Policy document
com.google.cloud.storage.Rpo Enums for the Recovery Point Objective (RPO) of dual-region buckets, which determines how fast data is replicated between regions. See Also: https://cloud.google.com/storage/docs/turbo-replication
com.google.cloud.storage.ServiceAccount A service account, with its specified scopes, authorized for this instance. See Also: Authenticating from Google Cloud Storage
com.google.cloud.storage.SignatureInfo Signature Info holds payload components of the string that requires signing. See Also: Components
com.google.cloud.storage.SignatureInfo.Builder
com.google.cloud.storage.Storage.BlobGetOption Class for specifying blob get options.
com.google.cloud.storage.Storage.BlobListOption Class for specifying blob list options.
com.google.cloud.storage.Storage.BlobRestoreOption Class for specifying blob restore options *
com.google.cloud.storage.Storage.BlobSourceOption Class for specifying blob source options.
com.google.cloud.storage.Storage.BlobTargetOption Class for specifying blob target options.
com.google.cloud.storage.Storage.BlobWriteOption Class for specifying blob write options.
com.google.cloud.storage.Storage.BucketGetOption Class for specifying bucket get options.
com.google.cloud.storage.Storage.BucketListOption Class for specifying bucket list options.
com.google.cloud.storage.Storage.BucketSourceOption Class for specifying bucket source options.
com.google.cloud.storage.Storage.BucketTargetOption Class for specifying bucket target options.
com.google.cloud.storage.Storage.ComposeRequest A class to contain all information needed for a Google Cloud Storage Compose operation. See Also: Compose Operation
com.google.cloud.storage.Storage.ComposeRequest.Builder
com.google.cloud.storage.Storage.ComposeRequest.SourceBlob Class for Compose source blobs.
com.google.cloud.storage.Storage.CopyRequest A class to contain all information needed for a Google Cloud Storage Copy operation.
com.google.cloud.storage.Storage.CopyRequest.Builder
com.google.cloud.storage.Storage.CreateHmacKeyOption Class for specifying createHmacKey options
com.google.cloud.storage.Storage.DeleteHmacKeyOption Class for specifying deleteHmacKey options
com.google.cloud.storage.Storage.GetHmacKeyOption Class for specifying getHmacKey options
com.google.cloud.storage.Storage.ListHmacKeysOption Class for specifying listHmacKeys options
com.google.cloud.storage.Storage.PostPolicyV4Option Class for specifying Post Policy V4 options. *
com.google.cloud.storage.Storage.SignUrlOption Class for specifying signed URL options.
com.google.cloud.storage.Storage.UpdateHmacKeyOption Class for specifying updateHmacKey options
com.google.cloud.storage.StorageBatch A batch of operations to be submitted to Google Cloud Storage using a single RPC request.

Example of using a batch request to delete, update and get a blob:

com.google.cloud.storage.StorageBatchResult This class holds a single result of a batch call to Cloud Storage.
com.google.cloud.storage.StorageClass Enums for the storage classes. See https://cloud.google.com/storage/docs/storage-classes for details.
com.google.cloud.storage.StorageOptions
com.google.cloud.storage.StorageOptions.Builder
com.google.cloud.storage.StorageOptions.DefaultStorageFactory Deprecated. Use HttpStorageFactory
com.google.cloud.storage.StorageOptions.DefaultStorageRpcFactory Deprecated. Use HttpStorageRpcFactory
com.google.cloud.storage.StorageRoles IAM roles specific to Storage. An overview of the permissions available to Storage and the capabilities they grant can be found in the Google Cloud Storage IAM documentation.

Interfaces

Interface Description
com.google.cloud.storage.BlobWriteSession A session to write an object to Google Cloud Storage.

A session can only write a single version of an object. If writing multiple versions of an object a new session must be created each time.

com.google.cloud.storage.Storage An interface for Google Cloud Storage. See Also: Google Cloud Storage
com.google.cloud.storage.StorageFactory An interface for Storage factories.
com.google.cloud.storage.StorageRetryStrategy A factory class which is used to provide access to ResultRetryAlgorithm for idempotent and non-idempotent calls made via Storage. Before Storage performs an operation it will determine if the operation is idempotent and select the appropriate ResultRetryAlgorithm to use for that invocation. See Also: #getDefaultStorageRetryStrategy(), #getUniformStorageRetryStrategy()
com.google.cloud.storage.TransportCompatibility Annotation which is used to convey which Cloud Storage API a class or method has compatibility with.

Not all operations are compatible with all transports.

Enums

Enum Description
com.google.cloud.storage.Acl.Entity.Type
com.google.cloud.storage.BucketInfo.DeleteRule.Type
com.google.cloud.storage.BucketInfo.PublicAccessPrevention Public Access Prevention enum with expected values. See Also: public-access-prevention
com.google.cloud.storage.HmacKey.HmacKeyState
com.google.cloud.storage.NotificationInfo.EventType
com.google.cloud.storage.NotificationInfo.PayloadFormat
com.google.cloud.storage.PostPolicyV4.ConditionV4Type
com.google.cloud.storage.Storage.BlobField
com.google.cloud.storage.Storage.BucketField
com.google.cloud.storage.Storage.PredefinedAcl
com.google.cloud.storage.Storage.UriScheme
com.google.cloud.storage.TransportCompatibility.Transport Enum representing the transports com.google.cloud.storage classes have implementations for.

Exceptions

Exception Description
com.google.cloud.storage.AsyncStorageTaskException This exception is used to preserve the caller's stacktrace when invoking an async task in a sync context. It will be added as a suppressed exception when propagating the async exception. This allows callers to catch ApiException thrown in an async operation, while still maintaining the call site.
com.google.cloud.storage.ParallelCompositeUploadException An exception which provides access to created objects during a Parallel Composite Upload that did not finish successfully.

This exception can occur when calling any method on the java.nio.channels.WritableByteChannel returned from BlobWriteSession#open(), in which

com.google.cloud.storage.StorageException Storage service exception. See Also: Google Cloud Storage error codes