I am having an issue trying to determine if a 'directory/folder' exists in Google Cloud Storage.
I know there is technically no concept of a 'directory' or 'folder' but I need to check if a particular prefix exists.
Here is the way i'm detecting if a Blob exists which works fine:
public boolean doesFileExist(String bucket, String prefix) {
Blob blob = storage.get(bucket, prefix);
return blob != null;
}
This seems to work when using an actual filename with an extension. However, using this for something like folder/ does not work.
Any suggestions?