修复了字符串中有特殊字符导致的路径冲突问题;修复ftp分块下载失败问题

This commit is contained in:
laoyuyu
2018-06-29 19:56:41 +08:00
parent 0a85477da3
commit 1d116f71b7
18 changed files with 73 additions and 203 deletions

View File

@@ -66,36 +66,12 @@ public class AnyRunnModule {
void start(String url) {
mUrl = url;
String path = Environment.getExternalStorageDirectory().getPath() + "/aaas.apk";
//File file = new File(path);
//if (file.exists()) {
// file.delete();
//}
Aria.download(this)
.load(url)
//.addHeader("Accept-Encoding", "gzip")
.addHeader("Referer", "http://www.bilibili.com/")
.addHeader("user-agent", "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36")
.setRequestMode(RequestEnum.GET)
//.setUrlProxy(Proxy.NO_PROXY)
.setFilePath(path)
.resetState()
.start();
//String[] urls = new String[] {
// "http://cdn-s1.touchfound.net/1526449199142_3617.png",
// "http://cdn-s1.touchfound.net/mtVmResources/1526287158571.zip",
// "http://cdn-s1.touchfound.net/1526450206960_2186.png",
// "http://cdn-s1.touchfound.net/1526449199025_1476.png"
//};
//for (int i = 0, len = urls.length; i < len; i++){
//
// Aria.download(this)
// .load(urls[i])
// //.addHeader("Accept-Encoding", "gzip")
// .setRequestMode(RequestEnum.GET)
// .setFilePath(Environment.getExternalStorageDirectory().getPath() + "/ggsg123456.apk" + i)
// //.resetState()
// .start();
//}
}
void startFtp(String url) {
@@ -103,26 +79,8 @@ public class AnyRunnModule {
Aria.download(this)
.loadFtp(url)
.login("lao", "123456")
//.addHeader("Accept-Encoding", "gzip")
.setFilePath(Environment.getExternalStorageDirectory().getPath() + "/")
//.resetState()
.start();
//String[] urls = new String[] {
// "http://cdn-s1.touchfound.net/1526449199142_3617.png",
// "http://cdn-s1.touchfound.net/mtVmResources/1526287158571.zip",
// "http://cdn-s1.touchfound.net/1526450206960_2186.png",
// "http://cdn-s1.touchfound.net/1526449199025_1476.png"
//};
//for (int i = 0, len = urls.length; i < len; i++){
//
// Aria.download(this)
// .load(urls[i])
// //.addHeader("Accept-Encoding", "gzip")
// .setRequestMode(RequestEnum.GET)
// .setFilePath(Environment.getExternalStorageDirectory().getPath() + "/ggsg123456.apk" + i)
// //.resetState()
// .start();
//}
}
void stop(String url) {