12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
-
-
- using System;
- using System.Collections.Generic;
- using Aliyun.OSS.Util;
- namespace Aliyun.OSS
- {
-
-
-
- public class DeleteObjectsRequest
- {
- private readonly IList<string> _keys = new List<string>();
- private string _encodingType;
-
-
-
- public string BucketName { get; private set; }
-
-
-
-
- public bool Quiet { get; private set; }
-
-
-
-
- public IList<string> Keys
- {
- get { return _keys; }
- }
-
-
-
-
- public string EncodingType
- {
- get
- {
- return _encodingType ?? HttpUtils.UrlEncodingType;
- }
- set
- {
- _encodingType = value;
- }
- }
-
-
-
-
-
- public DeleteObjectsRequest(string bucketName, IList<string> keys)
- : this(bucketName, keys, true)
- { }
-
-
-
-
-
-
- public DeleteObjectsRequest(string bucketName, IList<string> keys, bool quiet)
- {
- if (keys == null)
- throw new ArgumentException("The list of keys to be deleted should not be null");
- if (keys.Count <= 0)
- throw new ArgumentException("No any keys specified.");
- if (keys.Count > OssUtils.DeleteObjectsUpperLimit)
- throw new ArgumentException("Count of objects to be deleted exceeds upper limit");
- BucketName = bucketName;
- foreach (var key in keys)
- {
- OssUtils.CheckObjectKey(key);
- Keys.Add(key);
- }
- Quiet = quiet;
- }
- }
- }
|