// TODO: CreateBucketAsync public async Task <ListBucketResult> ListBucketAsync(string bucketName, ListBucketOptions options) { var request = new ListBucketRequest(Host, bucketName, options); var responseText = await SendAsync(request).ConfigureAwait(false); return(ListBucketResult.ParseXml(responseText)); }
public async Task <IReadOnlyList <IBlob> > ListAsync(string prefix, string continuationToken, int take = 1000) { var request = new ListBucketOptions { Prefix = prefix, ContinuationToken = continuationToken, MaxKeys = take }; var result = await client.ListBucketAsync(bucketName, request).ConfigureAwait(false); return(result.Items); }
public ListBucketRequest(string host, string bucketName, ListBucketOptions options) : base(HttpMethod.Get, host, bucketName, null) { options.QueryList.Add("list-type", "2"); if (options.QueryList.Count > 0) { RequestUri = new Uri(RequestUri.ToString() + options.QueryList.ToQueryString()); } CompletionOption = HttpCompletionOption.ResponseContentRead; /* * GET ?prefix=photos/2006/&delimiter=/ HTTP/1.1 * Host: quotes.s3.amazonaws.com * Date: Wed, 01 Mar 2009 12:00:00 GMT * Authorization: AWS 15B4D3461F177624206A:xQE0diMbLRepdf3YB+FIEXAMPLE= */ }
public ListBucketRequest(string host, string bucketName, ListBucketOptions options) : base(HttpMethod.Get, host, bucketName, null, options.Items) { CompletionOption = HttpCompletionOption.ResponseContentRead; }