xiaomi / galaxy-fds-sdk-java Goto Github PK
View Code? Open in Web Editor NEWJava SDK for Xiaomi File Data Storage.
License: Apache License 2.0
Java SDK for Xiaomi File Data Storage.
License: Apache License 2.0
the url [https://github.com/XiaoMi/galaxy-fds-sdk-java.git] in page:[https://github.com/XiaoMi/galaxy-fds-sdk-java] return 404
当前最新版本号是:3.0.14
我使用的版本是:3.0.14
GalaxyFDSClient.getObject(String bucketName, String objectName, String versionId, long pos)
该方法963行存在笔误bug
if (rtnObject == null) { closeResponseEntity(response); }
该bug在下载的时候,由于未能及时关闭连接,导致连接数超过默认的20时候,程序挂起。
删除条件判断即可
生成预签名需要填写对应Method、SubResource、ContentType,SubResource用来控制这个url签出后所带的参数,当要用于分片上出传初始化时,填写uploads,此外如果想通过预签名上传object,同时设置object为public,填写cannedAcl=PUBLIC_READ。 以Java sdk为例:
generatePresignedUri(BUCKET_NAME, OBJECT_NAME, Arrays.asList("cannedAcl=" + CannedAcl.PUBLIC_READ.name()), new Date(System.currentTimeMillis() + 1000000), HttpMethod.PUT, "");
fds 没有目录概念, 而是用 "/" 模拟目录, 因此listObjects 接口可以用来list 某一前缀的objects, delimiter
参数可以用于将相同prefix的objects聚合在一起, 利用delimiter
, 可以达到list 某个目录下的文件夹的效果。
listObject
接口默认最多返回1000个object,当bucket下object过多时,需要用到listNextBatchOfObjects
。listNextBatchOfObjects
的作用是根据上次结果继续list。其输入为FDSObjectListing。 Java 用例:
for (FDSObjectListing objectListing = fdsClient.listObjects(BUCKET_NAME, PREFIX, ""); objectListing != null;
objectListing = fdsClient.listNextBatchOfObjects(objectListing)) {
//do something
// objectListing.objectSummaries() 为预期objects
if (!objectListing.isTruncated()) {
break;
}
}
// PREFIX 以 / 为结尾
for (FDSObjectListing objectListing = fdsClient.listObjects(BUCKET_NAME, PREFIX, "/"); objectListing != null;
objectListing = fdsClient.listNextBatchOfObjects(objectListing)) {
//do something
// objectListing.getCommonPrefixes() 为预期目录
if (!objectListing.isTruncated()) {
break;
}
}
status=403, reason=[Galaxy FDS Error: Signature Does Not Match [Check http header or query parameter in request, Make sure your request is correctly signed]
status=403, reason=Galaxy FDS Error: Request Time Too Skewed [Date in your request header differs with local time in FDS too much, Check local time of client]
status=403, reason=Bucket Access Denied: Only owner is allowed to edit bucket property
status=403, reason=Object Access Denied: Object is not allowed outside access
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.