Merge branch '3.4.1'

This commit is contained in:
laoyuyu
2018-05-21 18:15:32 +08:00
62 changed files with 1042 additions and 464 deletions

View File

@@ -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,7 +15,10 @@ 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() {
return R.layout.activity_test;
@@ -40,15 +40,17 @@ 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();
//
////module.stop();
//module.stop(URL);
module.stop(URL);
break;
case R.id.cancel:

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() + "/ggsg1234.apk")
.resetState()
.setFilePath(Environment.getExternalStorageDirectory().getPath() + "/ggsg123456.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 startFtp(String url) {
mUrl = url;
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) {

View File

@@ -21,9 +21,9 @@ public class TestActivity extends BaseActivity<ActivityTestBinding> {
String TAG = "TestActivity";
//String URL = "http://58.210.9.131/tpk/sipgt//TDLYZTGH.tpk"; //chunked 下载
//private final String URL = "ftp://192.168.1.3:21/download//AriaPrj.rar";
private final String FILE_PATH = "/mnt/sdcard/SDK_Demo-release.apk";
private final String FILE_PATH = "/mnt/sdcard/AriaPrj.rar";
//private final String URL = "ftp://192.168.29.140:21/aa//你好";
private final String URL = "http://192.168.29.140:5000/upload/";
private final String URL = "ftp://192.168.29.140:21/upload/";
@Override protected int setLayoutId() {
return R.layout.activity_test;
@@ -76,18 +76,17 @@ public class TestActivity extends BaseActivity<ActivityTestBinding> {
switch (view.getId()) {
case R.id.start:
Aria.upload(this)
.load(FILE_PATH)
.loadFtp(FILE_PATH)
.login("lao", "123456")
.setUploadUrl(URL)
.setRequestMode(RequestEnum.POST)
.setExtendField("韩寒哈大双")
.setAttachment("file")
.start();
break;
case R.id.stop:
Aria.upload(this).load(FILE_PATH).stop();
Aria.upload(this).loadFtp(FILE_PATH).stop();
break;
case R.id.cancel:
Aria.upload(this).load(FILE_PATH).cancel();
Aria.upload(this).loadFtp(FILE_PATH).cancel();
break;
}
}