Reputation: 241
I know Google Cloud Storage doesn't manage folders, but let say I have this file:
mybucket/documentation/user
and I want all files that are within documentation/user but not those under documentation/user/version1/ or documentation/user/version2/
I want to see that under documentation/user there are 2 files (version1/ and version2/) but I don't want to get the files within recursive folders.
Is it possible using the JSON API? I know the concept of delitimer. But it only works on the root of the bucket. If I use the / as delimiter on the root I get al folders and files within the root of the bucket, but when I use the prefix documentation/user with delimiter "/" I get an empty list :-(
Upvotes: 4
Views: 2506
Reputation: 5644
Here's the generic rule -
https://www.googleapis.com/storage/v1/b/{bucket}/o?prefix={URL Encoded Name of the object}
In the above case it would be -
https://www.googleapis.com/storage/v1/b/{bucket}/o?prefix=document%2Fuser/
The delimiter '/' is used to contain the search result within the prefix. If no delimiter is used then all the children node are also searched and the result is returned.
Upvotes: 1