| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
下载 the latest JAR 或者 通过 Maven:
<dependency>
<groupId>com.qiniu</groupId>
<artifactId>qiniu-java-sdk</artifactId>
<version>[7.13.0, 7.13.99]</version>
</dependency>或者 Gradle:
implementation 'com.qiniu:qiniu-java-sdk:7.13.+'JDK 7 及以上
// 分片上传 v1
import com.qiniu.storage.UploadManager;
import com.qiniu.util.Auth;
import com.qiniu.storage.Configuration;
import com.qiniu.http.Response;
String accessKey = "Your AccessKey";
String secretKey = "Your SecretKey";
String bucketName = "upload to bucket";
Configuration cfg = new Configuration();
UploadManager uploadManager = new UploadManager(cfg);
Auth auth = Auth.create(accessKey, secretKey);
String token = auth.uploadToken(bucketName);
String key = "file save key";
Response r = uploadManager.put("hello world".getBytes(), key, token);
// 分片上传 v2
import com.qiniu.storage.UploadManager;
import com.qiniu.util.Auth;
import com.qiniu.storage.Configuration;
import com.qiniu.http.Response;
String accessKey = "Your AccessKey";
String secretKey = "Your SecretKey";
String bucketName = "upload to bucket";
Configuration cfg = new Configuration();
cfg.resumableUploadAPIVersion = Configuration.ResumableUploadAPIVersion.V2;
UploadManager uploadManager = new UploadManager(cfg);
Auth auth = Auth.create(accessKey, secretKey);
String token = auth.uploadToken(bucketName);
String key = "file save key";
Response r = uploadManager.put("hello world".getBytes(), key, token);其他使用请参考[开发指南]https://developer.qiniu.com/kodo/1239/java 详细的示例请参考[Examples]https://github.com/qiniu/java-sdk/tree/master/examples
$ ./gradlew build$ ./gradlew gen_eclipse详情参考代码提交指南。
The MIT License (MIT).详情见 License文件.
| Back | FazBrowse Home | New Git URL |