/// <inheritdoc /> public async Task <IEnumerable <string> > ListAsync(StorageListOptions options, CancellationToken cancellationToken = default) { ValidateFileName(options.Container); _logger.LogDebug("Listing contents of container {Container}", options.Container); var request = new ListObjectsV2Request { Prefix = $"{options.Container}/", BucketName = _bucketName }; ListObjectsV2Response response; var results = new List <string>(); do { response = await _client.ListObjectsV2Async(request, cancellationToken); request.ContinuationToken = response.NextContinuationToken; results.AddRange(response.S3Objects.Select(r => r.Key)); } while (response.IsTruncated); return(results); }
/// <inheritdoc /> public Task <IEnumerable <string> > ListAsync(StorageListOptions options, CancellationToken cancellationToken = default) { ValidateFileName(options.Container); _logger.LogDebug("Listing contents of container {Container}", options.Container); return(Task.FromResult( Directory.GetFiles(GetContainerLocation(options.Container)).AsEnumerable())); }
/// <inheritdoc /> public Task <IEnumerable <string> > ListAsync(StorageListOptions options, CancellationToken cancellationToken = default) { return(Task.FromResult(_contents.Keys .Where(x => x.StartsWith($"{options.Container}/")))); }