See: Description
Interface | Description |
---|---|
Storage |
An interface for Google Cloud Storage.
|
StorageFactory |
An interface for Storage factories.
|
StorageRetryStrategy |
A factory class which is used to provide access to
ResultRetryAlgorithm for idempotent
and non-idempotent calls made via Storage . |
Class | Description |
---|---|
Acl |
Access Control List for buckets or blobs.
|
Acl.Builder |
Builder for
Acl objects. |
Acl.Domain |
Class for ACL Domain entities.
|
Acl.Entity |
Base class for Access Control List entities.
|
Acl.Group |
Class for ACL Group entities.
|
Acl.Project |
Class for ACL Project entities.
|
Acl.Project.ProjectRole | |
Acl.RawEntity | |
Acl.Role | |
Acl.User |
Class for ACL User entities.
|
Blob |
An object in Google Cloud Storage.
|
Blob.BlobSourceOption |
Class for specifying blob source options when
Blob methods are used. |
Blob.Builder |
Builder for
Blob . |
BlobId |
Google Storage Object identifier.
|
BlobInfo |
Information about an object in Google Cloud Storage.
|
BlobInfo.Builder |
Builder for
BlobInfo . |
BlobInfo.CustomerEncryption |
Objects of this class hold information on the customer-supplied encryption key, if the blob is
encrypted using such a key.
|
BlobInfo.ImmutableEmptyMap<K,V> |
This class is meant for internal use only.
|
Bucket |
A Google cloud storage bucket.
|
Bucket.BlobTargetOption |
Class for specifying blob target options when
Bucket methods are used. |
Bucket.BlobWriteOption |
Class for specifying blob write options when
Bucket methods are used. |
Bucket.BucketSourceOption |
Class for specifying bucket source options when
Bucket methods are used. |
Bucket.Builder |
Builder for
Bucket . |
BucketInfo |
Google Storage bucket metadata;
|
BucketInfo.AgeDeleteRule | Deprecated
Use a
LifecycleRule with a DeleteLifecycleAction and use LifecycleCondition.Builder.setAge instead. |
BucketInfo.Autoclass | |
BucketInfo.Autoclass.Builder | |
BucketInfo.Builder |
Builder for
BucketInfo . |
BucketInfo.CreatedBeforeDeleteRule | Deprecated
Use a
LifecycleRule with an action DeleteLifecycleAction and a
condition LifecycleCondition.Builder.setCreatedBefore instead. |
BucketInfo.CustomPlacementConfig |
The bucket's custom placement configuration for Custom Dual Regions.
|
BucketInfo.CustomPlacementConfig.Builder | |
BucketInfo.DeleteRule | Deprecated
Use a
LifecycleRule with a DeleteLifecycleAction and a LifecycleCondition which is equivalent to a subclass of DeleteRule instead. |
BucketInfo.IamConfiguration |
The Bucket's IAM Configuration.
|
BucketInfo.IamConfiguration.Builder |
Builder for
IamConfiguration |
BucketInfo.IsLiveDeleteRule | Deprecated
Use a
LifecycleRule with a DeleteLifecycleAction and a condition
LifecycleCondition.Builder.setIsLive instead. |
BucketInfo.LifecycleRule |
Lifecycle rule for a bucket.
|
BucketInfo.LifecycleRule.AbortIncompleteMPUAction | |
BucketInfo.LifecycleRule.DeleteLifecycleAction | |
BucketInfo.LifecycleRule.LifecycleAction |
Base class for the Action to take when a Lifecycle Condition is met.
|
BucketInfo.LifecycleRule.LifecycleCondition |
Condition for a Lifecycle rule, specifies under what criteria an Action should be executed.
|
BucketInfo.LifecycleRule.LifecycleCondition.Builder |
Builder for
LifecycleCondition . |
BucketInfo.LifecycleRule.SetStorageClassLifecycleAction | |
BucketInfo.Logging |
The bucket's logging configuration, which defines the destination bucket and optional name
prefix for the current bucket's logs.
|
BucketInfo.Logging.Builder | |
BucketInfo.NumNewerVersionsDeleteRule | Deprecated
Use a
LifecycleRule with a DeleteLifecycleAction and a condition
LifecycleCondition.Builder.setNumberOfNewerVersions instead. |
CanonicalExtensionHeadersSerializer |
Canonical extension header serializer.
|
CopyWriter |
Google Storage blob copy writer.
|
Cors |
Cross-Origin Resource Sharing (CORS) configuration for a bucket.
|
Cors.Builder |
CORS configuration builder.
|
Cors.Origin |
Class for a CORS origin.
|
GrpcStorageOptions | |
GrpcStorageOptions.Builder | |
GrpcStorageOptions.GrpcStorageDefaults | |
GrpcStorageOptions.GrpcStorageFactory |
Internal implementation detail, only public to allow for
Serializable
compatibility in ServiceOptions . |
GrpcStorageOptions.GrpcStorageRpcFactory | Deprecated |
HmacKey |
HMAC key for a service account.
|
HmacKey.Builder |
Builder for
HmacKey objects. |
HmacKey.HmacKeyMetadata |
The metadata for a service account HMAC key.
|
HmacKey.HmacKeyMetadata.Builder |
Builder for
HmacKeyMetadata objects. |
HttpCopyWriter | |
HttpMethod |
Http method supported by Storage service.
|
HttpStorageOptions | |
HttpStorageOptions.Builder | |
HttpStorageOptions.HttpStorageDefaults | |
HttpStorageOptions.HttpStorageFactory |
Internal implementation detail, only public to allow for
Serializable . |
HttpStorageOptions.HttpStorageRpcFactory |
Internal implementation detail, only public to allow for
Serializable . |
Notification |
The class representing Pub/Sub notifications for the Storage.
|
Notification.Builder |
Builder for
Notification . |
NotificationInfo |
The class representing Pub/Sub Notification metadata for the Storage.
|
NotificationInfo.Builder |
Builder for
NotificationInfo . |
NotificationInfo.BuilderImpl |
Builder for
NotificationInfo . |
Option<O extends com.google.cloud.storage.UnifiedOpts.Opt> | Deprecated |
PostPolicyV4 |
Presigned V4 post policy.
|
PostPolicyV4.ConditionV4 |
Class for a specific POST policy document condition.
|
PostPolicyV4.PostConditionsV4 |
A helper class for specifying conditions in a V4 POST Policy document.
|
PostPolicyV4.PostConditionsV4.Builder | |
PostPolicyV4.PostFieldsV4 |
A helper class to define fields to be specified in a V4 POST request.
|
PostPolicyV4.PostFieldsV4.Builder | |
PostPolicyV4.PostPolicyV4Document |
Class for a V4 POST Policy document.
|
Rpo |
Enums for the Recovery Point Objective (RPO) of dual-region buckets, which determines how fast
data is replicated between regions.
|
ServiceAccount |
A service account, with its specified scopes, authorized for this instance.
|
SignatureInfo |
Signature Info holds payload components of the string that requires signing.
|
SignatureInfo.Builder | |
Storage.BlobGetOption |
Class for specifying blob get options.
|
Storage.BlobListOption |
Class for specifying blob list options.
|
Storage.BlobSourceOption |
Class for specifying blob source options.
|
Storage.BlobTargetOption |
Class for specifying blob target options.
|
Storage.BlobWriteOption |
Class for specifying blob write options.
|
Storage.BucketGetOption |
Class for specifying bucket get options.
|
Storage.BucketListOption |
Class for specifying bucket list options.
|
Storage.BucketSourceOption |
Class for specifying bucket source options.
|
Storage.BucketTargetOption |
Class for specifying bucket target options.
|
Storage.ComposeRequest |
A class to contain all information needed for a Google Cloud Storage Compose operation.
|
Storage.ComposeRequest.Builder | |
Storage.ComposeRequest.SourceBlob |
Class for Compose source blobs.
|
Storage.CopyRequest |
A class to contain all information needed for a Google Cloud Storage Copy operation.
|
Storage.CopyRequest.Builder | |
Storage.CreateHmacKeyOption |
Class for specifying createHmacKey options
|
Storage.DeleteHmacKeyOption |
Class for specifying deleteHmacKey options
|
Storage.GetHmacKeyOption |
Class for specifying getHmacKey options
|
Storage.ListHmacKeysOption |
Class for specifying listHmacKeys options
|
Storage.PostPolicyV4Option |
Class for specifying Post Policy V4 options.
|
Storage.SignUrlOption |
Class for specifying signed URL options.
|
Storage.UpdateHmacKeyOption |
Class for specifying updateHmacKey options
|
StorageBatch |
A batch of operations to be submitted to Google Cloud Storage using a single RPC request.
|
StorageBatchResult<T> |
This class holds a single result of a batch call to Cloud Storage.
|
StorageClass |
Enums for the storage classes.
|
StorageOptions | |
StorageOptions.Builder | |
StorageOptions.DefaultStorageFactory | Deprecated |
StorageOptions.DefaultStorageRpcFactory | Deprecated |
StorageRoles |
IAM roles specific to Storage.
|
Enum | Description |
---|---|
Acl.Entity.Type | |
BucketInfo.DeleteRule.Type | |
BucketInfo.PublicAccessPrevention |
Public Access Prevention enum with expected values.
|
HmacKey.HmacKeyState | |
NotificationInfo.EventType | |
NotificationInfo.PayloadFormat | |
PostPolicyV4.ConditionV4Type | |
Storage.BlobField | |
Storage.BucketField | |
Storage.PredefinedAcl | |
Storage.UriScheme | |
TransportCompatibility.Transport |
Enum representing the transports
com.google.cloud.storage classes have implementations
for. |
Exception | Description |
---|---|
StorageException |
Storage service exception.
|
Annotation Type | Description |
---|---|
TransportCompatibility |
Annotation which is used to convey which Cloud Storage API a class or method has compatibility
with.
|
Here's a simple usage example the Java Storage client. This example shows how to create a Storage object.
Storage storage = StorageOptions.getDefaultInstance().getService();
BlobId blobId = BlobId.of("bucket", "blob_name");
BlobInfo blobInfo = BlobInfo.newBuilder(blobId).setContentType("text/plain").build();
Blob blob = storage.create(blobInfo, "Hello, Cloud Storage!".getBytes(UTF_8));
This second example shows how to update an object's content if the object exists.
Storage storage = StorageOptions.getDefaultInstance().getService();
BlobId blobId = BlobId.of("bucket", "blob_name");
Blob blob = storage.get(blobId);
if (blob != null) {
byte[] prevContent = blob.getContent();
System.out.println(new String(prevContent, UTF_8));
WritableByteChannel channel = blob.writer();
channel.write(ByteBuffer.wrap("Updated content".getBytes(UTF_8)));
channel.close();
}
For more detailed code examples, see the sample library.
When using google-cloud from outside of App/Compute Engine, you have to specify a project ID and provide credentials.
Operations in this library are generally thread safe, except for the use of BlobReadChannel and BlobWriteChannel.
Copyright © 2023 Google LLC. All rights reserved.