upyun / java-sdk Goto Github PK
View Code? Open in Web Editor NEWUPYUN Java SDK
UPYUN Java SDK
我的代码是
private long usage;
private UpYun upYun;
upYun = new UpYun("...","...","...");
new Thread(new Runnable() {
@Override
public void run() {
usage = upYun.getBucketUsage();
Log.i("slz",usage+"");
}
}).start();
返回是-1
但是同样的代码在java项目中可以用
api:获取文件信息,上面说的是当指定文件不存在时返回null。但是实际上当不存在时会抛出异常:
Caused by: java.io.FileNotFoundException: http://v0.api.upyun.com/xxxxxx/path/to/file
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1872)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
at main.java.com.UpYun.getText(UpYun.java:906)
因为上传文件会存在覆盖问题,因此需要使用该api来进行文件判定(文档上面是这样写的)。
个人感觉在业务逻辑当中通过异常来进行判断不太优雅,可能使得业务逻辑的异常和真正出现的异常相混淆而出错。建议修复此问题
请提交到Maven的公共仓库
Description:
1. Please close the inputstream when the file uploaded
Now I need upload the file onto the app server directory for temporarily, then upload to upyun.
So we have a scheduled job to clean the temporary files on the app server.
If the inputstream of the uploaded file has not been closed, we couldn't delete it except we stop the app what we don't hope this happen.
2. Please support Chinese file name
When we upload the file which named by chinese, it will promt the messages below.
com.upyun.UpException: {"msg":"signature error","code":40100005,"id":"a0da1d010e78e4ad456abca06434719e"}
http://central.maven.org/maven2/com/upyun/java-sdk/4.1.1/
中没有4.1.1的jar
../
java-sdk-4.1.1-javadoc.jar 2019-04-10 08:31 232827
java-sdk-4.1.1-javadoc.jar.asc 2019-04-10 08:31 488
java-sdk-4.1.1-javadoc.jar.md5 2019-04-10 08:31 32
java-sdk-4.1.1-javadoc.jar.sha1 2019-04-10 08:31 40
java-sdk-4.1.1-sources.jar 2019-04-10 08:31 47991
java-sdk-4.1.1-sources.jar.asc 2019-04-10 08:31 488
java-sdk-4.1.1-sources.jar.md5 2019-04-10 08:31 32
java-sdk-4.1.1-sources.jar.sha1 2019-04-10 08:31 40
java-sdk-4.1.1.jar.asc 2019-04-10 08:31 488
java-sdk-4.1.1.pom.asc 2019-04-10 08:31 488
我看了一下sdk文档,貌似验证方式只有账号密码的方式。这样就需要把帐号密码保存到客户端中。这样就存在安全隐患了。
这方面有没有更安全的方式?
最近项目要调用视频相关的接口,但UPYUN JAVA API内部并没实现,那内部的HttpAction是否考虑暴露出来给开发者拿来调其它的HTTP接口呢?或者改为protected让开发者继承扩展?。。。。。
想要的功能是,已经上传的图片,不要重复上传,直接取上传过路径使用即可。请问这个功能该怎么做?
比如
Paging<Image> imageList = upyun.findByDir("/wtf/", 1, 20); // path, pageNo, pageSize
imageList.total()
imageList.result()
会深度遍历path下的所有目录 找出有效的图片文件 获取分页结果
maven构建项目 jetty7正常 8,9报如下异常
java.util.zip.ZipException: invalid entry size
移除UPYUN的JAR即可,请检查是否有冲突?
上传有SerialUploader 和 ParallelUploader 可以监听进度。
但是“下载”没有相应可以监听的接口。如果使用http下载,那速度,十分感人。。。
在 Android 上使用 java sdk 的删除功能进行操作的时候出现报错:
java.net.ProtocolException: DELETE does not support writing
我想设置proxy,可是并没有这种方法的设置
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.