See: Description
Interface | Description |
---|---|
Storage |
An interface for Google Cloud Storage.
|
StorageFactory |
An interface for Storage factories.
|
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 |
A Google cloud storage object.
|
Blob.BlobSourceOption |
Class for specifying blob source options when
Blob methods are used. |
Blob.Builder |
Builder for
Blob . |
BlobId |
Google Storage Object identifier.
|
BlobInfo |
Google Storage object metadata.
|
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.Builder |
Builder for
BucketInfo . |
BucketInfo.CreatedBeforeDeleteRule | Deprecated
Use a
LifecycleRule with an action DeleteLifecycleAction and a
condition LifecycleCondition.Builder.setCreatedBefore instead. |
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.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.
|
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. |
HttpMethod |
Http method supported by Storage service.
|
Option |
Base class for Storage operation option.
|
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.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 | |
StorageOptions.DefaultStorageRpcFactory | |
StorageRoles |
IAM roles specific to Storage.
|
Enum | Description |
---|---|
Acl.Entity.Type | |
BucketInfo.DeleteRule.Type | |
HmacKey.HmacKeyState | |
Storage.BlobField | |
Storage.BucketField | |
Storage.PredefinedAcl |
Exception | Description |
---|---|
StorageException |
Storage service exception.
|
Here's a simple usage example for using google-cloud from App/Compute Engine. This example shows how to create a Storage blob. For the complete source code see CreateBlob.java.
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 the blob's content if the blob exists. For the complete source code see UpdateBlob.java.
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();
}
When using google-cloud from outside of App/Compute Engine, you have to specify a project ID and provide credentials.
Copyright © 2019 Google LLC. All rights reserved.