This commit is contained in:
laoyuyu
2018-05-18 00:04:40 +08:00
parent fa08263805
commit 8c0eeaa035
28 changed files with 262 additions and 130 deletions

View File

@@ -62,16 +62,58 @@ public class AnyRunnModule {
L.d(TAG, "md5Code ==> " + CommonUtil.getFileMD5(new File(task.getDownloadPath())));
}
void start(String url) {
mUrl = url;
Aria.download(this)
.load(url)
.addHeader("Accept-Encoding", "gzip")
//.addHeader("Accept-Encoding", "gzip")
.setRequestMode(RequestEnum.GET)
.setFilePath(Environment.getExternalStorageDirectory().getPath() + "/ggsg123456.apk")
.resetState()
//.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) {
mUrl = url;
Aria.download(this)
.loadFtp(url)
.login("lao", "123456")
//.addHeader("Accept-Encoding", "gzip")
.setFilePath(Environment.getExternalStorageDirectory().getPath() + "/ftp_ggsg16.apk")
//.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) {