在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:qiniu/java-sdk开源软件地址:https://github.com/qiniu/java-sdk开源编程语言:Java 100.0%开源软件介绍:Qiniu Resource Storage SDK for Java安装下载 the latest JAR 或者 通过 Maven: <dependency>
<groupId>com.qiniu</groupId>
<artifactId>qiniu-java-sdk</artifactId>
<version>[7.11.0, 7.11.99]</version>
</dependency> 或者 Gradle: compile 'com.qiniu:qiniu-java-sdk:7.11.+' 运行环境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 生成Eclipse工程文件$ ./gradlew gen_eclipse 常见问题
代码贡献详情参考代码提交指南。 贡献记录联系我们
代码许可The MIT License (MIT).详情见 License文件. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论