Esempio n. 1
0
        private async Task <IEnumerable <S3ObjectVersion> > GetS3ObjectVersions(S3FileKey key)
        {
            var request = new ListVersionsRequest
            {
                BucketName = BucketNameConstructor.GetBucketName(key),
                Prefix     = key.Key
            };

            var result = new List <S3ObjectVersion>();
            ListVersionsResponse response;

            do
            {
                response = await AmazonS3.ListVersionsAsync(request);

                result.AddRange(response.Versions);

                request.VersionIdMarker = response.NextVersionIdMarker;
                request.KeyMarker       = response.NextKeyMarker;
            } while (response.IsTruncated);

            return(result);
        }