public class HttpStorageRpc extends Object implements StorageRpc
StorageRpc.Option, StorageRpc.RewriteRequest, StorageRpc.RewriteResponse
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_PROJECTION |
static String |
NO_ACL_PROJECTION |
Constructor and Description |
---|
HttpStorageRpc(StorageOptions options) |
Modifier and Type | Method and Description |
---|---|
com.google.api.services.storage.model.StorageObject |
compose(Iterable<com.google.api.services.storage.model.StorageObject> sources,
com.google.api.services.storage.model.StorageObject target,
Map<StorageRpc.Option,?> targetOptions)
Sends a compose request.
|
StorageRpc.RewriteResponse |
continueRewrite(StorageRpc.RewriteResponse previousResponse)
Continues rewriting on an already open rewrite channel.
|
com.google.api.services.storage.model.Bucket |
create(com.google.api.services.storage.model.Bucket bucket,
Map<StorageRpc.Option,?> options)
Creates a new bucket.
|
com.google.api.services.storage.model.StorageObject |
create(com.google.api.services.storage.model.StorageObject storageObject,
InputStream content,
Map<StorageRpc.Option,?> options)
Creates a new storage object.
|
com.google.api.services.storage.model.BucketAccessControl |
createAcl(com.google.api.services.storage.model.BucketAccessControl acl,
Map<StorageRpc.Option,?> options)
Creates a new ACL entry on the specified bucket.
|
com.google.api.services.storage.model.ObjectAccessControl |
createAcl(com.google.api.services.storage.model.ObjectAccessControl acl)
Creates a new ACL entry on the specified object.
|
RpcBatch |
createBatch()
Creates an empty batch.
|
com.google.api.services.storage.model.ObjectAccessControl |
createDefaultAcl(com.google.api.services.storage.model.ObjectAccessControl acl)
Creates a new default object ACL entry on the specified bucket.
|
com.google.api.services.storage.model.HmacKey |
createHmacKey(String serviceAccountEmail,
Map<StorageRpc.Option,?> options)
Creates a new HMAC key for the provided service account email.
|
com.google.api.services.storage.model.Notification |
createNotification(String bucket,
com.google.api.services.storage.model.Notification notification)
Creates a notification with the specified entity on the specified bucket.
|
boolean |
delete(com.google.api.services.storage.model.Bucket bucket,
Map<StorageRpc.Option,?> options)
Deletes the requested bucket.
|
boolean |
delete(com.google.api.services.storage.model.StorageObject blob,
Map<StorageRpc.Option,?> options)
Deletes the requested storage object.
|
boolean |
deleteAcl(String bucket,
String object,
Long generation,
String entity)
Deletes the ACL entry for the specified entity on the specified object.
|
boolean |
deleteAcl(String bucket,
String entity,
Map<StorageRpc.Option,?> options)
Deletes the ACL entry for the specified entity on the specified bucket.
|
boolean |
deleteDefaultAcl(String bucket,
String entity)
Deletes the default object ACL entry for the specified entity on the specified bucket.
|
void |
deleteHmacKey(com.google.api.services.storage.model.HmacKeyMetadata hmacKeyMetadata,
Map<StorageRpc.Option,?> options)
Deletes the HMAC key associated with the provided metadata object.
|
boolean |
deleteNotification(String bucket,
String notification)
Deletes the notification with the specified name on the specified object.
|
com.google.api.services.storage.model.Bucket |
get(com.google.api.services.storage.model.Bucket bucket,
Map<StorageRpc.Option,?> options)
Returns the requested bucket or
null if not found. |
com.google.api.services.storage.model.StorageObject |
get(com.google.api.services.storage.model.StorageObject object,
Map<StorageRpc.Option,?> options)
Returns the requested storage object or
null if not found. |
com.google.api.services.storage.model.ObjectAccessControl |
getAcl(String bucket,
String object,
Long generation,
String entity)
Returns the ACL entry for the specified entity on the specified object or
null if not
found. |
com.google.api.services.storage.model.BucketAccessControl |
getAcl(String bucket,
String entity,
Map<StorageRpc.Option,?> options)
Returns the ACL entry for the specified entity on the specified bucket or
null if not
found. |
com.google.api.services.storage.model.ObjectAccessControl |
getDefaultAcl(String bucket,
String entity)
Returns the default object ACL entry for the specified entity on the specified bucket or
null if not found. |
com.google.api.services.storage.model.HmacKeyMetadata |
getHmacKey(String accessId,
Map<StorageRpc.Option,?> options)
Returns the HMAC key associated with the provided access id.
|
com.google.api.services.storage.model.Policy |
getIamPolicy(String bucket,
Map<StorageRpc.Option,?> options)
Returns the IAM policy for the specified bucket.
|
com.google.api.services.storage.model.ServiceAccount |
getServiceAccount(String projectId)
Returns the service account associated with the given project.
|
com.google.cloud.Tuple<String,Iterable<com.google.api.services.storage.model.Bucket>> |
list(Map<StorageRpc.Option,?> options)
Lists the project's buckets.
|
com.google.cloud.Tuple<String,Iterable<com.google.api.services.storage.model.StorageObject>> |
list(String bucket,
Map<StorageRpc.Option,?> options)
Lists the bucket's blobs.
|
List<com.google.api.services.storage.model.BucketAccessControl> |
listAcls(String bucket,
Map<StorageRpc.Option,?> options)
Lists the ACL entries for the provided bucket.
|
List<com.google.api.services.storage.model.ObjectAccessControl> |
listAcls(String bucket,
String object,
Long generation)
Lists the ACL entries for the provided object.
|
List<com.google.api.services.storage.model.ObjectAccessControl> |
listDefaultAcls(String bucket)
Lists the default object ACL entries for the provided bucket.
|
com.google.cloud.Tuple<String,Iterable<com.google.api.services.storage.model.HmacKeyMetadata>> |
listHmacKeys(Map<StorageRpc.Option,?> options)
Lists the HMAC keys for the provided service account email.
|
List<com.google.api.services.storage.model.Notification> |
listNotifications(String bucket)
List the notifications for the provided bucket.
|
byte[] |
load(com.google.api.services.storage.model.StorageObject from,
Map<StorageRpc.Option,?> options)
Reads all the bytes from a storage object.
|
com.google.api.services.storage.model.Bucket |
lockRetentionPolicy(com.google.api.services.storage.model.Bucket bucket,
Map<StorageRpc.Option,?> options)
Lock retention policy for the provided bucket.
|
String |
open(com.google.api.services.storage.model.StorageObject object,
Map<StorageRpc.Option,?> options)
Opens a resumable upload channel for a given storage object.
|
String |
open(String signedURL)
Opens a resumable upload channel for a given signedURL.
|
StorageRpc.RewriteResponse |
openRewrite(StorageRpc.RewriteRequest rewriteRequest)
Sends a rewrite request to open a rewrite channel.
|
com.google.api.services.storage.model.Bucket |
patch(com.google.api.services.storage.model.Bucket bucket,
Map<StorageRpc.Option,?> options)
Updates bucket information.
|
com.google.api.services.storage.model.StorageObject |
patch(com.google.api.services.storage.model.StorageObject storageObject,
Map<StorageRpc.Option,?> options)
Updates the storage object's information.
|
com.google.api.services.storage.model.BucketAccessControl |
patchAcl(com.google.api.services.storage.model.BucketAccessControl acl,
Map<StorageRpc.Option,?> options)
Updates an ACL entry on the specified bucket.
|
com.google.api.services.storage.model.ObjectAccessControl |
patchAcl(com.google.api.services.storage.model.ObjectAccessControl acl)
Updates an ACL entry on the specified object.
|
com.google.api.services.storage.model.ObjectAccessControl |
patchDefaultAcl(com.google.api.services.storage.model.ObjectAccessControl acl)
Updates a default object ACL entry on the specified bucket.
|
com.google.cloud.Tuple<String,byte[]> |
read(com.google.api.services.storage.model.StorageObject from,
Map<StorageRpc.Option,?> options,
long position,
int bytes)
Reads the given amount of bytes from a storage object at the given position.
|
long |
read(com.google.api.services.storage.model.StorageObject from,
Map<StorageRpc.Option,?> options,
long position,
OutputStream outputStream)
Reads all the bytes from a storage object at the given position in to outputstream using direct
download.
|
com.google.api.services.storage.model.Policy |
setIamPolicy(String bucket,
com.google.api.services.storage.model.Policy policy,
Map<StorageRpc.Option,?> options)
Updates the IAM policy for the specified bucket.
|
com.google.api.services.storage.model.TestIamPermissionsResponse |
testIamPermissions(String bucket,
List<String> permissions,
Map<StorageRpc.Option,?> options)
Tests whether the caller holds the specified permissions for the specified bucket.
|
com.google.api.services.storage.model.HmacKeyMetadata |
updateHmacKey(com.google.api.services.storage.model.HmacKeyMetadata hmacKeyMetadata,
Map<StorageRpc.Option,?> options)
Updates an HMAC key for the provided metadata object and returns the updated object.
|
void |
write(String uploadId,
byte[] toWrite,
int toWriteOffset,
long destOffset,
int length,
boolean last)
Writes the provided bytes to a storage object at the provided location.
|
public static final String DEFAULT_PROJECTION
public static final String NO_ACL_PROJECTION
public HttpStorageRpc(StorageOptions options)
public com.google.api.services.storage.model.Bucket create(com.google.api.services.storage.model.Bucket bucket, Map<StorageRpc.Option,?> options)
StorageRpc
create
in interface StorageRpc
public com.google.api.services.storage.model.StorageObject create(com.google.api.services.storage.model.StorageObject storageObject, InputStream content, Map<StorageRpc.Option,?> options)
StorageRpc
create
in interface StorageRpc
public com.google.cloud.Tuple<String,Iterable<com.google.api.services.storage.model.Bucket>> list(Map<StorageRpc.Option,?> options)
StorageRpc
list
in interface StorageRpc
public com.google.cloud.Tuple<String,Iterable<com.google.api.services.storage.model.StorageObject>> list(String bucket, Map<StorageRpc.Option,?> options)
StorageRpc
list
in interface StorageRpc
public com.google.api.services.storage.model.Bucket get(com.google.api.services.storage.model.Bucket bucket, Map<StorageRpc.Option,?> options)
StorageRpc
null
if not found.get
in interface StorageRpc
public com.google.api.services.storage.model.StorageObject get(com.google.api.services.storage.model.StorageObject object, Map<StorageRpc.Option,?> options)
StorageRpc
null
if not found.get
in interface StorageRpc
public com.google.api.services.storage.model.Bucket patch(com.google.api.services.storage.model.Bucket bucket, Map<StorageRpc.Option,?> options)
StorageRpc
patch
in interface StorageRpc
public com.google.api.services.storage.model.StorageObject patch(com.google.api.services.storage.model.StorageObject storageObject, Map<StorageRpc.Option,?> options)
StorageRpc
storageObject
.patch
in interface StorageRpc
public boolean delete(com.google.api.services.storage.model.Bucket bucket, Map<StorageRpc.Option,?> options)
StorageRpc
delete
in interface StorageRpc
true
if the bucket was deleted, false
if it was not foundpublic boolean delete(com.google.api.services.storage.model.StorageObject blob, Map<StorageRpc.Option,?> options)
StorageRpc
delete
in interface StorageRpc
true
if the storage object was deleted, false
if it was not foundpublic com.google.api.services.storage.model.StorageObject compose(Iterable<com.google.api.services.storage.model.StorageObject> sources, com.google.api.services.storage.model.StorageObject target, Map<StorageRpc.Option,?> targetOptions)
StorageRpc
compose
in interface StorageRpc
public byte[] load(com.google.api.services.storage.model.StorageObject from, Map<StorageRpc.Option,?> options)
StorageRpc
load
in interface StorageRpc
public RpcBatch createBatch()
StorageRpc
createBatch
in interface StorageRpc
public long read(com.google.api.services.storage.model.StorageObject from, Map<StorageRpc.Option,?> options, long position, OutputStream outputStream)
StorageRpc
read
in interface StorageRpc
public com.google.cloud.Tuple<String,byte[]> read(com.google.api.services.storage.model.StorageObject from, Map<StorageRpc.Option,?> options, long position, int bytes)
StorageRpc
read
in interface StorageRpc
public void write(String uploadId, byte[] toWrite, int toWriteOffset, long destOffset, int length, boolean last)
StorageRpc
write
in interface StorageRpc
public String open(com.google.api.services.storage.model.StorageObject object, Map<StorageRpc.Option,?> options)
StorageRpc
open
in interface StorageRpc
public String open(String signedURL)
StorageRpc
open
in interface StorageRpc
public StorageRpc.RewriteResponse openRewrite(StorageRpc.RewriteRequest rewriteRequest)
StorageRpc
openRewrite
in interface StorageRpc
public StorageRpc.RewriteResponse continueRewrite(StorageRpc.RewriteResponse previousResponse)
StorageRpc
continueRewrite
in interface StorageRpc
public com.google.api.services.storage.model.BucketAccessControl getAcl(String bucket, String entity, Map<StorageRpc.Option,?> options)
StorageRpc
null
if not
found.getAcl
in interface StorageRpc
public boolean deleteAcl(String bucket, String entity, Map<StorageRpc.Option,?> options)
StorageRpc
deleteAcl
in interface StorageRpc
true
if the ACL was deleted, false
if it was not foundpublic com.google.api.services.storage.model.BucketAccessControl createAcl(com.google.api.services.storage.model.BucketAccessControl acl, Map<StorageRpc.Option,?> options)
StorageRpc
createAcl
in interface StorageRpc
public com.google.api.services.storage.model.BucketAccessControl patchAcl(com.google.api.services.storage.model.BucketAccessControl acl, Map<StorageRpc.Option,?> options)
StorageRpc
patchAcl
in interface StorageRpc
public List<com.google.api.services.storage.model.BucketAccessControl> listAcls(String bucket, Map<StorageRpc.Option,?> options)
StorageRpc
listAcls
in interface StorageRpc
public com.google.api.services.storage.model.ObjectAccessControl getDefaultAcl(String bucket, String entity)
StorageRpc
null
if not found.getDefaultAcl
in interface StorageRpc
public boolean deleteDefaultAcl(String bucket, String entity)
StorageRpc
deleteDefaultAcl
in interface StorageRpc
true
if the ACL was deleted, false
if it was not foundpublic com.google.api.services.storage.model.ObjectAccessControl createDefaultAcl(com.google.api.services.storage.model.ObjectAccessControl acl)
StorageRpc
createDefaultAcl
in interface StorageRpc
public com.google.api.services.storage.model.ObjectAccessControl patchDefaultAcl(com.google.api.services.storage.model.ObjectAccessControl acl)
StorageRpc
patchDefaultAcl
in interface StorageRpc
public List<com.google.api.services.storage.model.ObjectAccessControl> listDefaultAcls(String bucket)
StorageRpc
listDefaultAcls
in interface StorageRpc
public com.google.api.services.storage.model.ObjectAccessControl getAcl(String bucket, String object, Long generation, String entity)
StorageRpc
null
if not
found.getAcl
in interface StorageRpc
public boolean deleteAcl(String bucket, String object, Long generation, String entity)
StorageRpc
deleteAcl
in interface StorageRpc
true
if the ACL was deleted, false
if it was not foundpublic com.google.api.services.storage.model.ObjectAccessControl createAcl(com.google.api.services.storage.model.ObjectAccessControl acl)
StorageRpc
createAcl
in interface StorageRpc
public com.google.api.services.storage.model.ObjectAccessControl patchAcl(com.google.api.services.storage.model.ObjectAccessControl acl)
StorageRpc
patchAcl
in interface StorageRpc
public List<com.google.api.services.storage.model.ObjectAccessControl> listAcls(String bucket, String object, Long generation)
StorageRpc
listAcls
in interface StorageRpc
public com.google.api.services.storage.model.HmacKey createHmacKey(String serviceAccountEmail, Map<StorageRpc.Option,?> options)
StorageRpc
createHmacKey
in interface StorageRpc
public com.google.cloud.Tuple<String,Iterable<com.google.api.services.storage.model.HmacKeyMetadata>> listHmacKeys(Map<StorageRpc.Option,?> options)
StorageRpc
listHmacKeys
in interface StorageRpc
public com.google.api.services.storage.model.HmacKeyMetadata getHmacKey(String accessId, Map<StorageRpc.Option,?> options)
StorageRpc
getHmacKey
in interface StorageRpc
public com.google.api.services.storage.model.HmacKeyMetadata updateHmacKey(com.google.api.services.storage.model.HmacKeyMetadata hmacKeyMetadata, Map<StorageRpc.Option,?> options)
StorageRpc
updateHmacKey
in interface StorageRpc
public void deleteHmacKey(com.google.api.services.storage.model.HmacKeyMetadata hmacKeyMetadata, Map<StorageRpc.Option,?> options)
StorageRpc
deleteHmacKey
in interface StorageRpc
public com.google.api.services.storage.model.Policy getIamPolicy(String bucket, Map<StorageRpc.Option,?> options)
StorageRpc
getIamPolicy
in interface StorageRpc
public com.google.api.services.storage.model.Policy setIamPolicy(String bucket, com.google.api.services.storage.model.Policy policy, Map<StorageRpc.Option,?> options)
StorageRpc
setIamPolicy
in interface StorageRpc
public com.google.api.services.storage.model.TestIamPermissionsResponse testIamPermissions(String bucket, List<String> permissions, Map<StorageRpc.Option,?> options)
StorageRpc
testIamPermissions
in interface StorageRpc
public boolean deleteNotification(String bucket, String notification)
StorageRpc
deleteNotification
in interface StorageRpc
true
if the notification was deleted, false
if it was not foundpublic List<com.google.api.services.storage.model.Notification> listNotifications(String bucket)
StorageRpc
listNotifications
in interface StorageRpc
Notification
objects that exist on the bucket.public com.google.api.services.storage.model.Notification createNotification(String bucket, com.google.api.services.storage.model.Notification notification)
StorageRpc
createNotification
in interface StorageRpc
public com.google.api.services.storage.model.Bucket lockRetentionPolicy(com.google.api.services.storage.model.Bucket bucket, Map<StorageRpc.Option,?> options)
StorageRpc
lockRetentionPolicy
in interface StorageRpc
Bucket
object of the locked bucketpublic com.google.api.services.storage.model.ServiceAccount getServiceAccount(String projectId)
StorageRpc
getServiceAccount
in interface StorageRpc
Copyright © 2019 Google LLC. All rights reserved.