Esempio n. 1
0
        /// <inheritdoc />
        public async Task <Stream> RetrieveAsync(RemoteFileStoreContext context, CancellationToken cancellationToken)
        {
            var ctx     = (SimpleStorageServiceContext)context;
            var request = new GetObjectRequest
            {
                BucketName = ctx.BucketName,
                Key        = ctx.FilePath,
            };

            var response = await this.Client.GetObjectAsync(request, cancellationToken)
                           .ConfigureAwait(false);

            if (response.HttpStatusCode == HttpStatusCode.OK)
            {
                return(response.ResponseStream);
            }

            throw new InvalidOperationException();
        }
Esempio n. 2
0
 protected SimpleStorageServiceContext(RemoteFileStoreContext clone)
     : base(clone)
 {
 }