Beispiel #1
0
        public virtual async Task<CopyDocumentResponse> CopyAsync(CopyDocumentCommand cmd)
        {
            Ensure.That(cmd, "cmd").IsNotNull();

            var req = CreateRequest(cmd);
            var res = SendAsync(req);

            return await ProcessHttpCopyDocumentResponseAsync(res);
        }
Beispiel #2
0
 protected virtual string GenerateRequestUrl(CopyDocumentCommand cmd)
 {
     return GenerateDocumentRequestUrl(cmd.SrcId, cmd.SrcRev);
 }
Beispiel #3
0
        public virtual CopyDocumentResponse Copy(CopyDocumentCommand cmd)
        {
            Ensure.That(cmd, "cmd").IsNotNull();

            return CopyAsync(cmd).Result;
        }
Beispiel #4
0
        protected virtual HttpRequestMessage CreateRequest(CopyDocumentCommand cmd)
        {
            var req = new HttpRequest(new HttpMethod("COPY"), GenerateRequestUrl(cmd));

            req.Headers.Add("Destination", cmd.NewId);

            return req;
        }