CompleteMultipartUploadResultDeserializer.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (C) Alibaba Cloud Computing
  3. * All rights reserved.
  4. *
  5. * 版权所有 (C)阿里云计算有限公司
  6. */
  7. using System.IO;
  8. using Aliyun.OSS.Common.Communication;
  9. using Aliyun.OSS.Model;
  10. using Aliyun.OSS.Util;
  11. namespace Aliyun.OSS.Transform
  12. {
  13. internal class CompleteMultipartUploadResultDeserializer
  14. : ResponseDeserializer<CompleteMultipartUploadResult, CompleteMultipartUploadResultModel>
  15. {
  16. public CompleteMultipartUploadResultDeserializer(IDeserializer<Stream, CompleteMultipartUploadResultModel> contentDeserializer)
  17. : base(contentDeserializer)
  18. { }
  19. public override CompleteMultipartUploadResult Deserialize(ServiceResponse xmlStream)
  20. {
  21. var result = ContentDeserializer.Deserialize(xmlStream.Content);
  22. return new CompleteMultipartUploadResult
  23. {
  24. BucketName = result.Bucket,
  25. Key = result.Key,
  26. Location = result.Location,
  27. ETag = OssUtils.TrimQuotes(result.ETag)
  28. };
  29. }
  30. }
  31. }