상속: BaseCommand
예제 #1
0
 /// <summary>
 /// Initiates the asynchronous execution of the OpenStream operation. 
 /// <seealso cref="M:Amazon.S3.Transfer.TransferUtility.Upload"/>
 /// </summary>
 /// <param name="request">
 /// 	Contains all the parameters used for opening a stream to an S3 object.
 /// </param>
 /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
 /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the AsyncState property.</param>
 /// <exception cref="T:System.ArgumentNullException"></exception>
 /// <exception cref="T:System.Net.WebException"></exception>
 /// <exception cref="T:Amazon.S3.AmazonS3Exception"></exception>
 /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; 
 /// this value is also needed when invoking EndOpenStream.</returns>
 public IAsyncResult BeginOpenStream(TransferUtilityOpenStreamRequest request, AsyncCallback callback, object state)
 {
     OpenStreamCommand command = new OpenStreamCommand(this._s3Client, request);
     return beginOperation(command, callback, state);
 }
예제 #2
0
 /// <summary>
 /// 	Returns a stream to read the contents from Amazon S3 as 
 /// 	specified by the <c>TransferUtilityOpenStreamRequest</c>.
 /// 	The caller of this method is responsible for closing the stream.
 /// </summary>
 /// <param name="request">
 /// 	Contains all the parameters used for opening a stream to an S3 object.
 /// </param>
 /// <returns>
 /// 	A stream containing contents returned from Amazon S3.
 /// </returns>
 public Stream OpenStream(TransferUtilityOpenStreamRequest request)
 {
     OpenStreamCommand command = new OpenStreamCommand(this._s3Client, request);
     command.Execute();
     return command.ResponseStream;
 }
예제 #3
0
 /// <summary>
 /// 	Returns a stream to read the contents from Amazon S3 as 
 /// 	specified by the <c>TransferUtilityOpenStreamRequest</c>.
 /// 	The caller of this method is responsible for closing the stream.
 /// </summary>
 /// <param name="request">
 /// 	Contains all the parameters required for the OpenStream operation.
 /// </param>
 /// <param name="cancellationToken">
 ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
 /// </param>
 /// <returns>The task object representing the asynchronous operation.</returns>
 public async Task<Stream> OpenStreamAsync(TransferUtilityOpenStreamRequest request, CancellationToken cancellationToken = default(CancellationToken))
 {
     OpenStreamCommand command = new OpenStreamCommand(this._s3Client, request);
     await command.ExecuteAsync(cancellationToken).ConfigureAwait(continueOnCapturedContext: false);
     return command.ResponseStream;
 }