DoesObjectExistRequest.cs 869 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using COSXML.Common;
  5. namespace COSXML.Model.Object
  6. {
  7. /// <summary>
  8. /// 检查对象是否存在, 封装了Head接口
  9. /// <see href="https://cloud.tencent.com/document/product/436/7745"/>
  10. /// </summary>
  11. public sealed class DoesObjectExistRequest : ObjectRequest
  12. {
  13. public DoesObjectExistRequest(string bucket, string key)
  14. : base(bucket, key)
  15. {
  16. this.method = CosRequestMethod.HEAD;
  17. }
  18. /// <summary>
  19. /// 特定版本的对象
  20. /// </summary>
  21. /// <param name="versionId"></param>
  22. public void SetVersionId(string versionId)
  23. {
  24. if (versionId != null)
  25. {
  26. SetQueryParameter(CosRequestHeaderKey.VERSION_ID, versionId);
  27. }
  28. }
  29. }
  30. }