Example #1
0
 /// <summary>
 /// 复制单个文件
 /// </summary>
 /// <param name="bucketSrc">需要复制的文件所在的空间名</param>
 /// <param name="keySrc">需要复制的文件key</param>
 /// <param name="bucketDest">目标文件所在的空间名</param>
 /// <param name="keyDest">标文件key</param>
 public static void Copy(string bucketSrc, string keySrc, string bucketDest, string keyDest)
 {
     RSClient client = new RSClient();
     CallRet ret = client.Copy(new EntryPathPair(bucketSrc, keySrc, bucketDest, keyDest));
     if (ret.OK)
     {
         Console.WriteLine("Copy OK");
     }
     else
     {
         Console.WriteLine("Failed to Copy");
     }
 }
Example #2
0
 public void CopyTest()
 {
     RSClient target = new RSClient(); // TODO: 初始化为适当的值
     string key = NewKey;
     EntryPathPair pathPair = new EntryPathPair(Bucket, tmpKeys[0], key); // TODO: 初始化为适当的值
     CallRet actual;
     actual = target.Copy(pathPair);
     if (actual.OK) {
         RSHelper.RSDel (Bucket, key);
     }
     Assert.IsTrue(actual.OK, "CopyTest Failure");
 }