bashoogzaad bashoogzaad - 1 month ago 17
Java Question

Retrieve ACL of specific file with Google Cloud Storage Client Library for Java

I currently have the following problem:

I would like to check the access control list of an object in my bucket on Google Cloud Storage from my App Engine App. I know I can set the ACL with the

, but I want to read it from a specific file before passing it to the user.

I am not able to find a method with which this is possible. Am I missing something here or is the Google Cloud Storage REST API the only way to do this? ( In that case: can anyone explain why this method is not available in the client library?


Maybe I am also missing something, but isn't it through the getAcl method of the GcsFileOptions class?

You first get the file metadata through getMetadata() on the gcs service and then get the GcsFileOptions via metadata.getOptions()