ucloud / ufile-sdk-java Goto Github PK
View Code? Open in Web Editor NEWUCloud 对象存储官方 SDK
Home Page: https://www.ucloud.cn/
License: Apache License 2.0
UCloud 对象存储官方 SDK
Home Page: https://www.ucloud.cn/
License: Apache License 2.0
请问,示例中,有没有增量同步的api ,只同步已经修改过的文件?
例如文件: file.pdf.PDF
一样能正常打开
但是MimeTypeUtil.getMimeType(keyName);会解析不出来
`
public static String getMimeType(String fileName) {
JLog.T(TAG, "[file name]:" + fileName);
if (fileName == null || fileName == "" || !fileName.contains("."))
return MIME_TYPE_MAP.get("");
int lastDot = fileName.lastIndexOf(".");
if (lastDot > (fileName.length() - 2))
fileName = "";
else
fileName = fileName.substring(lastDot + 1);
JLog.T(TAG, "[suffix]:" + fileName);
// 转成小写去MIME_TYPE_MAP匹配
String res = MIME_TYPE_MAP.get(fileName.toLowerCase(Locale.ROOT));
return res == null || res.isEmpty() ? MIME_TYPE_MAP.get("") : res;
}
`
文件上传时报错,使用的控制台生成的令牌,使用管理工具可以上传,报错如下:
cn.ucloud.ufile.exception.UfileServerException: {"ResponseCode":403,"RetCode":-148658,"ErrMsg":"invalid signature","X-SessionId":"48b70da8-12d9-4609-88cf-3548193810df"}
只允许输入 byte[] 会造成使用方不得不将全部要上传的数据读到内存中,占用大量内存
UfileClient.object(OBJECT_AUTHORIZER, config)
.putObject(file, "text/plain")
.nameAs("save as keyName")
.toBucket("upload to which bucket")
请问这里的nameas跟tobucket是要填写什么呢
Content-Disposition
等响应头?ObjectConfig.host()
?FileUtil.readFileContent(ClassLoader.getSystemResourceAsStream("mime-type.json")) 无法加载到json文件。
我设置的值是10 ,但是一个小时过去了。这段代码生成的url,还是能访问到文件
String url = UfileClient.object(Constants.OBJECT_AUTHORIZER, config) .getDownloadUrlFromPrivateBucket(keyName, bucketName, expiresDuration) .createUrl();
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.