/// <inheritdoc />
 public abstract Task <RemoteDocumentTarget> ExecuteAsync(IDocument source, RemoteMissingTarget destination, CancellationToken cancellationToken);
예제 #2
0
        /// <inheritdoc />
        public override async Task <RemoteDocumentTarget> ExecuteAsync(IDocument source, RemoteMissingTarget destination, CancellationToken cancellationToken)
        {
            using (var stream = await source.OpenReadAsync(cancellationToken).ConfigureAwait(false))
            {
                var content = new StreamContent(stream);
                using (var response = await Client
                                      .PutAsync(destination.DestinationUrl, content, cancellationToken)
                                      .ConfigureAwait(false))
                {
                    response.EnsureSuccessStatusCode();
                }
            }

            return(new RemoteDocumentTarget(destination.Parent, destination.Name, destination.DestinationUrl, this));
        }