This commit is contained in:
AriaLyy
2017-05-24 11:26:33 +08:00
parent e5aa798df5
commit 5b0951c765
9 changed files with 60 additions and 47 deletions

View File

@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 9
targetSdkVersion 23
versionCode 102
versionName "3.0.3"
versionCode 310
versionName "3.1.0"
}
buildTypes {
release {

View File

@ -93,16 +93,18 @@ import org.xml.sax.SAXException;
SAXParser parser = factory.newSAXParser();
parser.parse(APP.getAssets().open("aria_config.xml"), helper);
} catch (ParserConfigurationException | IOException | SAXException e) {
Log.d(TAG, e.toString());
Log.e(TAG, e.toString());
}
}
/**
* 如果需要在代码中修改下载配置,请使用以下方法
*
* @<code> //修改最大任务队列数
* Aria.get(this).getDownloadConfig().setMaxTaskNum(3);
* </code>
* <pre>
* <code>
* //修改最大任务队列数
* Aria.get(this).getDownloadConfig().setMaxTaskNum(3);
* </code>
* </pre>
*/
public Configuration.DownloadConfig getDownloadConfig() {
return mDConfig;
@ -110,10 +112,12 @@ import org.xml.sax.SAXException;
/**
* 如果需要在代码中修改下载配置,请使用以下方法
*
* @<code> //修改最大任务队列数
* Aria.get(this).getUploadConfig().setMaxTaskNum(3);
* </code>
* <pre>
* <code>
* //修改最大任务队列数
* Aria.get(this).getUploadConfig().setMaxTaskNum(3);
* </code>
* </pre>
*/
public Configuration.UploadConfig getUploadConfig() {
return mUConfig;
@ -242,8 +246,6 @@ import org.xml.sax.SAXException;
* 初始化配置文件
*/
private void initConfig() {
//File dFile = new File(APP.getFilesDir().getPath() + Configuration.DOWNLOAD_CONFIG_FILE);
//File uFile = new File(APP.getFilesDir().getPath() + Configuration.UPLOAD_CONFIG_FILE);
File xmlFile = new File(APP.getFilesDir().getPath() + Configuration.XML_FILE);
if (!xmlFile.exists()) {
loadConfig();

View File

@ -56,13 +56,17 @@ public class DownloadTask implements ITask {
/**
* @return 返回原始byte速度需要你在配置文件中配置
* <pre>
* <download>
* ...
* <convertSpeed value="false"/>
* </download>
* {@code
* <xml>
* <download>
* ...
* <convertSpeed value="false"/>
* </download>
*
* 或在代码中设置
* Aria.get(this).getDownloadConfig().setConvertSpeed(false);
* 或在代码中设置
* Aria.get(this).getDownloadConfig().setConvertSpeed(false);
* </xml>
* }
* </pre>
* 才能生效
*/
@ -73,13 +77,17 @@ public class DownloadTask implements ITask {
/**
* @return 返回转换单位后的速度需要你在配置文件中配置转换完成后为1b/s、1k/s、1m/s、1g/s、1t/s
* <pre>
* <download>
* ...
* <convertSpeed value="true"/>
* </download>
* {@code
* <xml>
* <download>
* ...
* <convertSpeed value="true"/>
* </download>
*
* 或在代码中设置
* Aria.get(this).getDownloadConfig().setConvertSpeed(true);
* 或在代码中设置
* Aria.get(this).getDownloadConfig().setConvertSpeed(true);
* </xml>
* }
* </pre>
* 才能生效
*/

View File

@ -111,13 +111,17 @@ public class UploadTask implements ITask {
/**
* @return 返回原始byte速度需要你在配置文件中配置
* <pre>
* <upload>
* ...
* <convertSpeed value="false"/>
* </upload>
* {@code
* <xml>
* <upload>
* ...
* <convertSpeed value="false"/>
* </upload>
*
* 或在代码中设置
* Aria.get(this).getUploadConfig().setConvertSpeed(false);
* 或在代码中设置
* Aria.get(this).getUploadConfig().setConvertSpeed(false);
* </xml>
* }
* </pre>
* 才能生效
*/
@ -128,13 +132,17 @@ public class UploadTask implements ITask {
/**
* @return 返回转换单位后的速度需要你在配置文件中配置转换完成后为1b/s、1k/s、1m/s、1g/s、1t/s
* <pre>
* <upload>
* ...
* <convertSpeed value="true"/>
* </upload>
* {@code
* <xml>
* <upload>
* ...
* <convertSpeed value="true"/>
* </upload>
*
* 或在代码中设置
* Aria.get(this).getUploadConfig().setConvertSpeed(true);
* 或在代码中设置
* Aria.get(this).getUploadConfig().setConvertSpeed(true);
* </xml>
* }
* </pre>
*
* 才能生效