Class HttpStorageRpc

java.lang.Object
com.google.cloud.storage.spi.v1.HttpStorageRpc
All Implemented Interfaces:
com.google.cloud.ServiceRpc, StorageRpc

public class HttpStorageRpc extends Object implements StorageRpc
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.google.cloud.storage.spi.v1.StorageRpc

    StorageRpc.Option, StorageRpc.RewriteRequest, StorageRpc.RewriteResponse
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    HttpStorageRpc(StorageOptions options, com.google.api.client.json.JsonFactory jsonFactory)
     
  • Method Summary

    Modifier and Type
    Method
    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.
    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.
    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 the notification for a given 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 id on the bucket.
    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.
    long
    Requests current byte offset from Cloud Storage API.
    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
    Returns the IAM policy for the specified bucket.
    com.google.api.services.storage.model.Notification
    getNotification(String bucket, String notification)
    Gets the notification with the specified id.
    com.google.api.services.storage.model.ServiceAccount
    Returns the service account associated with the given project.
    com.google.api.services.storage.Storage
     
    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.
    com.google.cloud.Tuple<String,Iterable<com.google.api.services.storage.model.Bucket>>
    Lists the project's buckets.
    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.BucketAccessControl>
    listAcls(String bucket, Map<StorageRpc.Option,?> options)
    Lists the ACL entries for the provided bucket.
    List<com.google.api.services.storage.model.ObjectAccessControl>
    Lists the default object ACL entries for the provided bucket.
    com.google.cloud.Tuple<String,Iterable<com.google.api.services.storage.model.HmacKeyMetadata>>
    Lists the HMAC keys for the provided service account email.
    List<com.google.api.services.storage.model.Notification>
    Retrieves the list of notifications associated with the 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.
    open(com.google.api.services.storage.model.StorageObject object, Map<StorageRpc.Option,?> options)
    Opens a resumable upload channel for a given storage object.
    open(String signedURL)
    Opens a resumable upload channel for a given signedURL.
    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.api.services.storage.model.StorageObject
    queryCompletedResumableUpload(String uploadId, long totalBytes)
    Attempts to retrieve the StorageObject from a completed resumable upload.
    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.StorageObject
    restore(com.google.api.services.storage.model.StorageObject object, Map<StorageRpc.Option,?> options)
    If an object has been soft-deleted, restores it and returns the restored object.j
    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.
    com.google.api.services.storage.model.StorageObject
    writeWithResponse(String uploadId, byte[] toWrite, int toWriteOffset, long destOffset, int length, boolean last)
    Writes the provided bytes to a storage object at the provided location.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • HttpStorageRpc

      public HttpStorageRpc(StorageOptions options)
    • HttpStorageRpc

      public HttpStorageRpc(StorageOptions options, com.google.api.client.json.JsonFactory jsonFactory)
  • Method Details

    • getStorage

      public com.google.api.services.storage.Storage getStorage()
      Specified by:
      getStorage in interface StorageRpc
    • create

      public com.google.api.services.storage.model.Bucket create(com.google.api.services.storage.model.Bucket bucket, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Creates a new bucket.
      Specified by:
      create in interface StorageRpc
    • create

      public com.google.api.services.storage.model.StorageObject create(com.google.api.services.storage.model.StorageObject storageObject, InputStream content, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Creates a new storage object.
      Specified by:
      create in interface StorageRpc
    • list

      public com.google.cloud.Tuple<String,Iterable<com.google.api.services.storage.model.Bucket>> list(Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Lists the project's buckets.
      Specified by:
      list in interface StorageRpc
    • list

      public com.google.cloud.Tuple<String,Iterable<com.google.api.services.storage.model.StorageObject>> list(String bucket, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Lists the bucket's blobs.
      Specified by:
      list in interface StorageRpc
    • get

      public com.google.api.services.storage.model.Bucket get(com.google.api.services.storage.model.Bucket bucket, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Returns the requested bucket or null if not found.
      Specified by:
      get in interface StorageRpc
    • get

      public com.google.api.services.storage.model.StorageObject get(com.google.api.services.storage.model.StorageObject object, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Returns the requested storage object or null if not found.
      Specified by:
      get in interface StorageRpc
    • restore

      public com.google.api.services.storage.model.StorageObject restore(com.google.api.services.storage.model.StorageObject object, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      If an object has been soft-deleted, restores it and returns the restored object.j
      Specified by:
      restore in interface StorageRpc
    • patch

      public com.google.api.services.storage.model.Bucket patch(com.google.api.services.storage.model.Bucket bucket, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Updates bucket information.
      Specified by:
      patch in interface StorageRpc
    • patch

      public com.google.api.services.storage.model.StorageObject patch(com.google.api.services.storage.model.StorageObject storageObject, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Updates the storage object's information. Original metadata are merged with metadata in the provided storageObject.
      Specified by:
      patch in interface StorageRpc
    • delete

      public boolean delete(com.google.api.services.storage.model.Bucket bucket, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Deletes the requested bucket.
      Specified by:
      delete in interface StorageRpc
      Returns:
      true if the bucket was deleted, false if it was not found
    • delete

      public boolean delete(com.google.api.services.storage.model.StorageObject blob, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Deletes the requested storage object.
      Specified by:
      delete in interface StorageRpc
      Returns:
      true if the storage object was deleted, false if it was not found
    • compose

      public 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)
      Description copied from interface: StorageRpc
      Sends a compose request.
      Specified by:
      compose in interface StorageRpc
    • load

      public byte[] load(com.google.api.services.storage.model.StorageObject from, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Reads all the bytes from a storage object.
      Specified by:
      load in interface StorageRpc
    • createBatch

      public RpcBatch createBatch()
      Description copied from interface: StorageRpc
      Creates an empty batch.
      Specified by:
      createBatch in interface StorageRpc
    • read

      public long read(com.google.api.services.storage.model.StorageObject from, Map<StorageRpc.Option,?> options, long position, OutputStream outputStream)
      Description copied from interface: StorageRpc
      Reads all the bytes from a storage object at the given position in to outputstream using direct download.
      Specified by:
      read in interface StorageRpc
      Returns:
      number of bytes downloaded, returns 0 if position higher than length.
    • read

      public com.google.cloud.Tuple<String,byte[]> read(com.google.api.services.storage.model.StorageObject from, Map<StorageRpc.Option,?> options, long position, int bytes)
      Description copied from interface: StorageRpc
      Reads the given amount of bytes from a storage object at the given position.
      Specified by:
      read in interface StorageRpc
    • write

      public void write(String uploadId, byte[] toWrite, int toWriteOffset, long destOffset, int length, boolean last)
      Description copied from interface: StorageRpc
      Writes the provided bytes to a storage object at the provided location.
      Specified by:
      write in interface StorageRpc
    • getCurrentUploadOffset

      public long getCurrentUploadOffset(String uploadId)
      Description copied from interface: StorageRpc
      Requests current byte offset from Cloud Storage API. Used to recover from a failure in some bytes were committed successfully to the open resumable session.
      Specified by:
      getCurrentUploadOffset in interface StorageRpc
      Parameters:
      uploadId - resumable upload ID URL
    • queryCompletedResumableUpload

      public com.google.api.services.storage.model.StorageObject queryCompletedResumableUpload(String uploadId, long totalBytes)
      Description copied from interface: StorageRpc
      Attempts to retrieve the StorageObject from a completed resumable upload. When a resumable upload completes, the response will be the up-to-date StorageObject metadata. This up-to-date metadata can then be used to validate the total size of the object along with new generation and other information.

      If for any reason, the response to the final PUT to a resumable upload is not received, this method can be used to query for the up-to-date StorageObject. If the upload is complete, this method can be used to access the StorageObject independently from any other liveness or conditional criteria requirements that are otherwise applicable when using StorageRpc.get(StorageObject, Map).

      Specified by:
      queryCompletedResumableUpload in interface StorageRpc
      Parameters:
      uploadId - resumable upload ID URL
      totalBytes - the total number of bytes that should have been written.
    • writeWithResponse

      public com.google.api.services.storage.model.StorageObject writeWithResponse(String uploadId, byte[] toWrite, int toWriteOffset, long destOffset, int length, boolean last)
      Description copied from interface: StorageRpc
      Writes the provided bytes to a storage object at the provided location. If last=true returns metadata of the updated object, otherwise returns null.
      Specified by:
      writeWithResponse in interface StorageRpc
      Parameters:
      uploadId - resumable upload ID
      toWrite - a portion of the content
      toWriteOffset - starting position in the toWrite array
      destOffset - starting position in the destination data
      length - the number of bytes to be uploaded
      last - true, if toWrite is the final content portion
      Returns:
    • open

      public String open(com.google.api.services.storage.model.StorageObject object, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Opens a resumable upload channel for a given storage object.
      Specified by:
      open in interface StorageRpc
    • open

      public String open(String signedURL)
      Description copied from interface: StorageRpc
      Opens a resumable upload channel for a given signedURL.
      Specified by:
      open in interface StorageRpc
    • openRewrite

      public StorageRpc.RewriteResponse openRewrite(StorageRpc.RewriteRequest rewriteRequest)
      Description copied from interface: StorageRpc
      Sends a rewrite request to open a rewrite channel.
      Specified by:
      openRewrite in interface StorageRpc
    • continueRewrite

      public StorageRpc.RewriteResponse continueRewrite(StorageRpc.RewriteResponse previousResponse)
      Description copied from interface: StorageRpc
      Continues rewriting on an already open rewrite channel.
      Specified by:
      continueRewrite in interface StorageRpc
    • getAcl

      public com.google.api.services.storage.model.BucketAccessControl getAcl(String bucket, String entity, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Returns the ACL entry for the specified entity on the specified bucket or null if not found.
      Specified by:
      getAcl in interface StorageRpc
    • deleteAcl

      public boolean deleteAcl(String bucket, String entity, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Deletes the ACL entry for the specified entity on the specified bucket.
      Specified by:
      deleteAcl in interface StorageRpc
      Returns:
      true if the ACL was deleted, false if it was not found
    • createAcl

      public com.google.api.services.storage.model.BucketAccessControl createAcl(com.google.api.services.storage.model.BucketAccessControl acl, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Creates a new ACL entry on the specified bucket.
      Specified by:
      createAcl in interface StorageRpc
    • patchAcl

      public com.google.api.services.storage.model.BucketAccessControl patchAcl(com.google.api.services.storage.model.BucketAccessControl acl, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Updates an ACL entry on the specified bucket.
      Specified by:
      patchAcl in interface StorageRpc
    • listAcls

      public List<com.google.api.services.storage.model.BucketAccessControl> listAcls(String bucket, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Lists the ACL entries for the provided bucket.
      Specified by:
      listAcls in interface StorageRpc
    • getDefaultAcl

      public com.google.api.services.storage.model.ObjectAccessControl getDefaultAcl(String bucket, String entity)
      Description copied from interface: StorageRpc
      Returns the default object ACL entry for the specified entity on the specified bucket or null if not found.
      Specified by:
      getDefaultAcl in interface StorageRpc
    • deleteDefaultAcl

      public boolean deleteDefaultAcl(String bucket, String entity)
      Description copied from interface: StorageRpc
      Deletes the default object ACL entry for the specified entity on the specified bucket.
      Specified by:
      deleteDefaultAcl in interface StorageRpc
      Returns:
      true if the ACL was deleted, false if it was not found
    • createDefaultAcl

      public com.google.api.services.storage.model.ObjectAccessControl createDefaultAcl(com.google.api.services.storage.model.ObjectAccessControl acl)
      Description copied from interface: StorageRpc
      Creates a new default object ACL entry on the specified bucket.
      Specified by:
      createDefaultAcl in interface StorageRpc
    • patchDefaultAcl

      public com.google.api.services.storage.model.ObjectAccessControl patchDefaultAcl(com.google.api.services.storage.model.ObjectAccessControl acl)
      Description copied from interface: StorageRpc
      Updates a default object ACL entry on the specified bucket.
      Specified by:
      patchDefaultAcl in interface StorageRpc
    • listDefaultAcls

      public List<com.google.api.services.storage.model.ObjectAccessControl> listDefaultAcls(String bucket)
      Description copied from interface: StorageRpc
      Lists the default object ACL entries for the provided bucket.
      Specified by:
      listDefaultAcls in interface StorageRpc
    • getAcl

      public com.google.api.services.storage.model.ObjectAccessControl getAcl(String bucket, String object, Long generation, String entity)
      Description copied from interface: StorageRpc
      Returns the ACL entry for the specified entity on the specified object or null if not found.
      Specified by:
      getAcl in interface StorageRpc
    • deleteAcl

      public boolean deleteAcl(String bucket, String object, Long generation, String entity)
      Description copied from interface: StorageRpc
      Deletes the ACL entry for the specified entity on the specified object.
      Specified by:
      deleteAcl in interface StorageRpc
      Returns:
      true if the ACL was deleted, false if it was not found
    • createAcl

      public com.google.api.services.storage.model.ObjectAccessControl createAcl(com.google.api.services.storage.model.ObjectAccessControl acl)
      Description copied from interface: StorageRpc
      Creates a new ACL entry on the specified object.
      Specified by:
      createAcl in interface StorageRpc
    • patchAcl

      public com.google.api.services.storage.model.ObjectAccessControl patchAcl(com.google.api.services.storage.model.ObjectAccessControl acl)
      Description copied from interface: StorageRpc
      Updates an ACL entry on the specified object.
      Specified by:
      patchAcl in interface StorageRpc
    • listAcls

      public List<com.google.api.services.storage.model.ObjectAccessControl> listAcls(String bucket, String object, Long generation)
      Description copied from interface: StorageRpc
      Lists the ACL entries for the provided object.
      Specified by:
      listAcls in interface StorageRpc
    • createHmacKey

      public com.google.api.services.storage.model.HmacKey createHmacKey(String serviceAccountEmail, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Creates a new HMAC key for the provided service account email.
      Specified by:
      createHmacKey in interface StorageRpc
    • listHmacKeys

      public com.google.cloud.Tuple<String,Iterable<com.google.api.services.storage.model.HmacKeyMetadata>> listHmacKeys(Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Lists the HMAC keys for the provided service account email.
      Specified by:
      listHmacKeys in interface StorageRpc
    • getHmacKey

      public com.google.api.services.storage.model.HmacKeyMetadata getHmacKey(String accessId, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Returns the HMAC key associated with the provided access id.
      Specified by:
      getHmacKey in interface StorageRpc
    • updateHmacKey

      public com.google.api.services.storage.model.HmacKeyMetadata updateHmacKey(com.google.api.services.storage.model.HmacKeyMetadata hmacKeyMetadata, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Updates an HMAC key for the provided metadata object and returns the updated object. Only updates the State field.
      Specified by:
      updateHmacKey in interface StorageRpc
    • deleteHmacKey

      public void deleteHmacKey(com.google.api.services.storage.model.HmacKeyMetadata hmacKeyMetadata, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Deletes the HMAC key associated with the provided metadata object.
      Specified by:
      deleteHmacKey in interface StorageRpc
    • getIamPolicy

      public com.google.api.services.storage.model.Policy getIamPolicy(String bucket, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Returns the IAM policy for the specified bucket.
      Specified by:
      getIamPolicy in interface StorageRpc
    • setIamPolicy

      public com.google.api.services.storage.model.Policy setIamPolicy(String bucket, com.google.api.services.storage.model.Policy policy, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Updates the IAM policy for the specified bucket.
      Specified by:
      setIamPolicy in interface StorageRpc
    • testIamPermissions

      public com.google.api.services.storage.model.TestIamPermissionsResponse testIamPermissions(String bucket, List<String> permissions, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Tests whether the caller holds the specified permissions for the specified bucket.
      Specified by:
      testIamPermissions in interface StorageRpc
    • deleteNotification

      public boolean deleteNotification(String bucket, String notification)
      Description copied from interface: StorageRpc
      Deletes the notification with the specified id on the bucket.
      Specified by:
      deleteNotification in interface StorageRpc
      Returns:
      true if the notification has been deleted, false if not found
    • listNotifications

      public List<com.google.api.services.storage.model.Notification> listNotifications(String bucket)
      Description copied from interface: StorageRpc
      Retrieves the list of notifications associated with the bucket.
      Specified by:
      listNotifications in interface StorageRpc
      Returns:
      a list of Notification objects that exist on the bucket.
    • createNotification

      public com.google.api.services.storage.model.Notification createNotification(String bucket, com.google.api.services.storage.model.Notification notification)
      Description copied from interface: StorageRpc
      Creates the notification for a given bucket.
      Specified by:
      createNotification in interface StorageRpc
      Returns:
      the created notification.
    • getNotification

      public com.google.api.services.storage.model.Notification getNotification(String bucket, String notification)
      Description copied from interface: StorageRpc
      Gets the notification with the specified id.
      Specified by:
      getNotification in interface StorageRpc
      Returns:
      the Notification object with the given id or null if not found
    • lockRetentionPolicy

      public com.google.api.services.storage.model.Bucket lockRetentionPolicy(com.google.api.services.storage.model.Bucket bucket, Map<StorageRpc.Option,?> options)
      Description copied from interface: StorageRpc
      Lock retention policy for the provided bucket.
      Specified by:
      lockRetentionPolicy in interface StorageRpc
      Returns:
      a Bucket object of the locked bucket
    • getServiceAccount

      public com.google.api.services.storage.model.ServiceAccount getServiceAccount(String projectId)
      Description copied from interface: StorageRpc
      Returns the service account associated with the given project.
      Specified by:
      getServiceAccount in interface StorageRpc
      Returns:
      the ID of the project to fetch the service account for.