move() public method

public move ( string srcBucket, string srcKey, string destBucket, string destKey ) : Qiniu.Http.HttpResult
srcBucket string
srcKey string
destBucket string
destKey string
return Qiniu.Http.HttpResult
Exemplo n.º 1
0
        public void bktMgrTest()
        {
            //Settings.load();
            Settings.LoadFromFile();
            string testResUrl = "http://test.fengyh.cn/qiniu/files/hello.txt";
            Mac mac = new Mac(Settings.AccessKey, Settings.SecretKey);
            BucketManager target = new BucketManager(mac);

            target.fetch(testResUrl, Settings.Bucket, "test_BucketManager.txt");

            target.stat(Settings.Bucket, "test_BucketManager.txt");

            target.copy(Settings.Bucket, "test_BucketManager.txt", Settings.Bucket, "copy_BucketManager.txt", true);

            target.move(Settings.Bucket, "copy_BucketManager.txt", Settings.Bucket, "move_BucketManager.txt", true);

            target.delete(Settings.Bucket, "test_BucketManager.txt");

            DomainsResult domainsResult = target.domains(Settings.Bucket);

            BucketsResult bucketsResult = target.buckets();
        }
Exemplo n.º 2
0
        /// <summary>
        /// 移动文件
        /// </summary>
        public static void move()
        {
            Mac mac = new Mac(Settings.AccessKey, Settings.SecretKey);

            string srcBucket = "SRC_BUCKET";
            string srcKey = "SRC_KEY";
            string dstBucket = "SRC_BUCKET";
            string dstKey = "DST_BUCKET";

            BucketManager bm = new BucketManager(mac);
            HttpResult result = bm.move(srcBucket, srcKey, dstBucket, dstKey);

            //支持force参数, bool force = true/false
            //HttpResult result = bm.move(srcBucket, srcKey, dstBucket, dstKey, force);
        }