Exemple #1
0
 public static void BatchCopy(string bucket, string[] keys)
 {
     List<EntryPathPair> pairs = new List<EntryPathPair>();
     foreach (string key in keys)
     {
         EntryPathPair entry = new EntryPathPair(bucket, key, Guid.NewGuid().ToString());
         pairs.Add(entry);
     }
     RSClient client = new RSClient();
     client.BatchCopy(pairs.ToArray());
 }
Exemple #2
0
        public void BatchCopyTest()
        {
            RSClient target = new RSClient(); // TODO: 初始化为适当的值

            EntryPathPair[] entryPathPairs = new EntryPathPair[2]; // TODO: 初始化为适当的值
            string tmpKey = NewKey;
            string tmpKey2 = NewKey;
            entryPathPairs[0] = new EntryPathPair(Bucket, tmpKeys[0], tmpKey);
            entryPathPairs[1] = new EntryPathPair(Bucket, tmpKeys[1], tmpKey2);
            CallRet actual;
            actual = target.BatchCopy(entryPathPairs);
            if (actual.OK) {
                RSHelper.RSDel (Bucket, tmpKey);
                RSHelper.RSDel (Bucket, tmpKey2);
            }
            Assert.IsTrue(actual.OK, "BatchStatTest Failure"); ;
        }