Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion Frends.Community.AWS/DownloadTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,21 @@ CancellationToken cancellationToken
var paths = new List<string>();
var targetPath = input.S3Directory + input.SearchPattern;
var mask = new Regex(input.SearchPattern.Replace(".", "[.]").Replace("*", ".*").Replace("?", "."));


var request = new ListObjectsV2Request
{
BucketName = parameters.BucketName,
Encoding = null,
FetchOwner = false,
// Added ternary to account for Frends not including null as parameter by default.
Prefix = string.IsNullOrWhiteSpace(input.S3Directory) ? null : input.S3Directory,
};


using (var s3Client = (AmazonS3Client)Utilities.GetS3Client(parameters))
{
var allObjectsResponse = await s3Client.ListObjectsAsync(parameters.BucketName, cancellationToken);
var allObjectsResponse = await s3Client.ListObjectsV2Async(request, cancellationToken);
var allObjectsInDirectory = allObjectsResponse.S3Objects;
foreach (var fileObject in allObjectsInDirectory)
{
Expand Down