DeleteBucketWebsiteCommand.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright (C) Alibaba Cloud Computing
  3. * All rights reserved.
  4. *
  5. * 版权所有 (C)阿里云计算有限公司
  6. */
  7. using System;
  8. using Aliyun.OSS.Common.Communication;
  9. using Aliyun.OSS.Util;
  10. using System.Collections.Generic;
  11. namespace Aliyun.OSS.Commands
  12. {
  13. internal class DeleteBucketWebsiteCommand : OssCommand
  14. {
  15. private readonly string _bucketName;
  16. protected override HttpMethod Method
  17. {
  18. get { return HttpMethod.Delete; }
  19. }
  20. protected override string Bucket
  21. {
  22. get
  23. {
  24. return _bucketName;
  25. }
  26. }
  27. private DeleteBucketWebsiteCommand(IServiceClient client, Uri endpoint, ExecutionContext context,
  28. string bucketName)
  29. : base(client, endpoint, context)
  30. {
  31. OssUtils.CheckBucketName(bucketName);
  32. _bucketName = bucketName;
  33. }
  34. public static DeleteBucketWebsiteCommand Create(IServiceClient client, Uri endpoint,
  35. ExecutionContext context,
  36. string bucketName)
  37. {
  38. return new DeleteBucketWebsiteCommand(client, endpoint, context, bucketName);
  39. }
  40. protected override IDictionary<string, string> Parameters
  41. {
  42. get
  43. {
  44. return new Dictionary<string, string>()
  45. {
  46. { RequestParameters.SUBRESOURCE_WEBSITE, null }
  47. };
  48. }
  49. }
  50. }
  51. }