I have a small sample code that is supposed to return only objects inside "folder" in Google Cloud Storage:
var storage = StorageClient.Create();
var listObjectOptions = new ListObjectsOptions(){ Delimiter = ""};
try
{
foreach (var storageObject in storage.ListObjects(bucketName, "firstSubFolder/secondSubFolder/", listObjectOptions))
{
Console.WriteLine(storageObject.Name);
}
}
catch (Exception e)
{
//
}
What this code does, it returns not only objects inside secondSubFolder but it also returns the folder itself :"firstSubFolder/secondSubFolder/". I have tried many combinations using delimiter and prefixes, but can't really get it to return only objects from folder. Am I missing something or is this the way how it normally works?