All that I found, it\'s this method GET Bucket But I can\'t understand how can I get only a list of folders in the current folder. Which prefix and delimiter I need to use?
Alternatively another simpler approach is using https://github.com/minio/minio-dotnet
Minio .Net implements minimal API's to work with Amazon S3 and other compatible storage solutions.
Following example shows how you can filter out only directories. Here the CommonPrefix is abstracted as a folder through the ListObjects() API.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Minio;
using Minio.Xml;
namespace Minio.Examples
{
class ListObjects
{
static int Main(string[] args)
{
var client = new MinioClient("https://s3.amazonaws.com", "ACCESSKEY", "SECRETKEY");
var items = client.ListObjects("bucket");
foreach (Item item in items)
{
if (item.IsDir)
{
Console.Out.WriteLine("{0}", item.Key);
}
}
return 0;
}
}
}