I’ve created an object inside a folder in Google Cloud Storage whith the following OptionsBuilder object:
GSFileOptionsBuilder optionsBuilder = new GSFileOptionsBuilder()
.setBucket("bucket")
.setKey("folder/obj.csv")
.setMimeType("text/csv");
Making the next structure:
bucket >> folder >> obj.csv
When I run the gsutil command to get ACL for “bucket” and “obj.csv” works fine, however when I execute it for “folder” throws this exception:
GSResponseError: status=404, code=NoSuchKey, reason=Not Found.
The exactly command I run is: gsutil getacl gs://bucket/folder/ > acl.txt
How I can get and set permissions on a folder?
You can only retrieve the ACL of an object or a bucket. There is no such thing as a “folder” in GCS, so you can’t set or get the ACL of a folder. I suggest you read the Concepts and Terminology section of the developer guide carefully. In particular, the section on object names: