Ejemplo n.º 1
0
        public async Task <MultipartDownloadStatus> MultipartDownloadAsync(string bucketName, string resource, Stream output, int bufferSize = 16777216, int numParallelParts = 4, CancellationToken token = default)
        {
            IAsyncEnumerable <GetObjectResponse> asyncEnum = _operations.MultipartDownloadAsync(bucketName, resource, output, bufferSize, numParallelParts, null, token);

            await foreach (GetObjectResponse obj in asyncEnum.WithCancellation(token))
            {
                if (!obj.IsSuccess)
                {
                    return(MultipartDownloadStatus.Incomplete);
                }
            }

            return(MultipartDownloadStatus.Ok);
        }
Ejemplo n.º 2
0
        public async Task <MultipartDownloadStatus> ExecuteMultipartAsync(Stream output, CancellationToken token = default)
        {
            IAsyncEnumerable <GetObjectResponse> async = _objectOperations.MultipartDownloadAsync(_request.BucketName, _request.Resource, output, config: CopyProperties, token: token);

            await foreach (GetObjectResponse resp in async.WithCancellation(token))
            {
                if (!resp.IsSuccess)
                {
                    return(MultipartDownloadStatus.Incomplete);
                }
            }

            return(MultipartDownloadStatus.Ok);
        }