Skip to content

Commit 9861682

Browse files
committed
文档
1 parent 7e4c351 commit 9861682

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
## 使用
2626

27-
参考文档:[七牛云存储 Java SDK 使用指南](http://docs.qiniutek.com/v2/sdk/java/)
27+
参考文档:[七牛云存储 Java SDK 使用指南](http://developer.qiniu.com/docs/v6/sdk/java-sdk.html)
2828

2929

3030
## 贡献代码

docs/README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,24 @@ public class UploadFile {
209209

210210
### 3.4 断点续上传、分块并行上传
211211

212-
建设中...
212+
于普通上传类似:
213+
```{java}
214+
private void uploadFile() throws AuthException, JSONException{
215+
PutPolicy p = new PutPolicy(bucketName);
216+
p.returnBody = "{\"key\": $(key), \"hash\": $(etag),\"mimeType\": $(mimeType)}";
217+
String upToken = p.token(mac);
218+
PutRet ret = ResumeableIoApi.put(file, upToken, key, mimeType);
219+
}
220+
221+
private void uploadStream() throws AuthException, JSONException, FileNotFoundException{
222+
PutPolicy p = new PutPolicy(bucketName);
223+
String upToken = p.token(mac);
224+
FileInputStream fis = new FileInputStream(file);
225+
PutRet ret = ResumeableIoApi.put(fis, upToken, key, mimeType);
226+
}
227+
228+
```
229+
key,mimeType 可为null。
213230

214231
<a name="io-put-policy"></a>
215232

0 commit comments

Comments
 (0)