UploadPartResponseDeserializer.cs 966 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (C) Alibaba Cloud Computing
  3. * All rights reserved.
  4. *
  5. * 版权所有 (C)阿里云计算有限公司
  6. */
  7. using Aliyun.OSS.Common.Communication;
  8. using Aliyun.OSS.Util;
  9. namespace Aliyun.OSS.Transform
  10. {
  11. internal class UploadPartResultDeserializer : ResponseDeserializer<UploadPartResult, UploadPartResult>
  12. {
  13. private readonly int _partNumber;
  14. public UploadPartResultDeserializer(int partNumber)
  15. : base(null)
  16. {
  17. _partNumber = partNumber;
  18. }
  19. public override UploadPartResult Deserialize(ServiceResponse xmlStream)
  20. {
  21. var result = new UploadPartResult();
  22. if (xmlStream.Headers.ContainsKey(HttpHeaders.ETag))
  23. {
  24. result.ETag = OssUtils.TrimQuotes(xmlStream.Headers[HttpHeaders.ETag]);
  25. }
  26. result.PartNumber = _partNumber;
  27. return result;
  28. }
  29. }
  30. }