This commit is contained in:
@@ -3,12 +3,9 @@ package com.arialyy.simple.test;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.arialyy.aria.core.inf.AbsEntity;
|
||||
import com.arialyy.aria.util.ALog;
|
||||
import com.arialyy.simple.R;
|
||||
import com.arialyy.simple.base.BaseActivity;
|
||||
import com.arialyy.simple.databinding.ActivityTestBinding;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by laoyuyu on 2018/4/13.
|
||||
@@ -18,8 +15,9 @@ public class AnyRunActivity extends BaseActivity<ActivityTestBinding> {
|
||||
AnyRunnModule module;
|
||||
String[] urls;
|
||||
int index = 0;
|
||||
String URL = "http://static.gaoshouyou.com/d/12/0d/7f120f50c80d2e7b8c4ba24ece4f9cdd.apk";
|
||||
//String URL = "http://static.gaoshouyou.com/d/12/0d/7f120f50c80d2e7b8c4ba24ece4f9cdd.apk";
|
||||
//String URL = "http://static.gaoshouyou.com/d/22/94/822260b849944492caadd2983f9bb624.apk";
|
||||
private final String URL = "ftp://192.168.29.140:21/download//AriaPrj.rar";
|
||||
//String URL = "https://dl.genymotion.com/releases/genymotion-2.12.1/genymotion-2.12.1-vbox.exe";
|
||||
|
||||
@Override protected int setLayoutId() {
|
||||
@@ -42,9 +40,12 @@ public class AnyRunActivity extends BaseActivity<ActivityTestBinding> {
|
||||
// module.start(urls[index]);
|
||||
// index++;
|
||||
//}
|
||||
module.start(URL);
|
||||
List<AbsEntity> list = Aria.download(this).getTotalTaskList();
|
||||
ALog.d(TAG, "size ==> " + list.size());
|
||||
//for (int i = 0; i < 10; i++) {
|
||||
|
||||
module.startFtp(URL);
|
||||
//}
|
||||
//List<AbsEntity> list = Aria.download(this).getTotalTaskList();
|
||||
//ALog.d(TAG, "size ==> " + list.size());
|
||||
break;
|
||||
case R.id.stop:
|
||||
//List<AbsEntity> list = Aria.download(this).getTotalTaskList();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user