Skip to content

Commit ad79f72

Browse files
committed
Merge pull request #192 from clouddxy/master
add force
2 parents 421016b + fa3a1a6 commit ad79f72

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

src/main/java/com/qiniu/storage/BucketManager.java

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,24 @@ public void copy(String from_bucket, String from_key, String to_bucket, String t
166166
rsPost(path);
167167
}
168168

169+
/**
170+
* 复制文件。要求空间在同一账号下, 可以添加force参数为true强行复制文件。
171+
*
172+
* @param from_bucket
173+
* @param from_key
174+
* @param to_bucket
175+
* @param to_key
176+
* @param force
177+
* @throws QiniuException
178+
*/
179+
public void copy(String from_bucket, String from_key, String to_bucket,
180+
String to_key, boolean force) throws QiniuException {
181+
String from = entry(from_bucket, from_key);
182+
String to = entry(to_bucket, to_key);
183+
String path = "/copy/" + from + "/" + to + "/force/" + force;
184+
rsPost(path);
185+
}
186+
169187
/**
170188
* 移动文件。要求空间在同一账号下。
171189
*
@@ -182,6 +200,24 @@ public void move(String from_bucket, String from_key, String to_bucket, String t
182200
rsPost(path);
183201
}
184202

203+
/**
204+
* 移动文件。要求空间在同一账号下, 可以添加force参数为true强行移动文件。
205+
*
206+
* @param from_bucket
207+
* @param from_key
208+
* @param to_bucket
209+
* @param to_key
210+
* @param force
211+
* @throws QiniuException
212+
*/
213+
public void move(String from_bucket, String from_key, String to_bucket,
214+
String to_key, boolean force) throws QiniuException {
215+
String from = entry(from_bucket, from_key);
216+
String to = entry(to_bucket, to_key);
217+
String path = "/move/" + from + "/" + to + "/force/" + force;
218+
rsPost(path);
219+
}
220+
185221
/**
186222
* 修改完文件mimeTYpe
187223
*

0 commit comments

Comments
 (0)