From 97705701e4587855e428cd247e9be78d02faec23 Mon Sep 17 00:00:00 2001 From: laoyuyu <511455842@qq.com> Date: Mon, 3 Dec 2018 10:58:30 +0800 Subject: [PATCH] 3.5.2 --- .../com/arialyy/aria/util/CommonUtil.java | 5 +-- README.md | 42 ++++++++++--------- .../simple/download/SingleTaskActivity.java | 5 +++ build.gradle | 2 +- 4 files changed, 30 insertions(+), 24 deletions(-) diff --git a/Aria/src/main/java/com/arialyy/aria/util/CommonUtil.java b/Aria/src/main/java/com/arialyy/aria/util/CommonUtil.java index a72ff551..24b27a91 100644 --- a/Aria/src/main/java/com/arialyy/aria/util/CommonUtil.java +++ b/Aria/src/main/java/com/arialyy/aria/util/CommonUtil.java @@ -82,7 +82,7 @@ public class CommonUtil { /** * 删除文件 * @param path 文件路径 - * @return {@code true}删除成功、{@co'de false}删除失败 + * @return {@code true}删除成功、{@code false}删除失败 */ public static boolean deleteFile(String path){ if (TextUtils.isEmpty(path)){ @@ -155,8 +155,7 @@ public class CommonUtil { try { fis = new FileInputStream(filePath); ObjectInputStream oois = new ObjectInputStream(fis); - Object obj = oois.readObject(); - return obj; + return oois.readObject(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { diff --git a/README.md b/README.md index 6a4e9f26..23d6813b 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,8 @@ Aria有以下特点: [![Download](https://api.bintray.com/packages/arialyy/maven/AriaApi/images/download.svg)](https://bintray.com/arialyy/maven/AriaApi/_latestVersion) [![Download](https://api.bintray.com/packages/arialyy/maven/AriaCompiler/images/download.svg)](https://bintray.com/arialyy/maven/AriaCompiler/_latestVersion) ```java -compile 'com.arialyy.aria:aria-core:3.5.1' -annotationProcessor 'com.arialyy.aria:aria-compiler:3.5.1' +compile 'com.arialyy.aria:aria-core:3.5.2' +annotationProcessor 'com.arialyy.aria:aria-compiler:3.5.2' ``` 如果出现android support,请将 `compile 'com.arialyy.aria:aria-core:'`替换为 ``` @@ -101,25 +101,27 @@ protected void onCreate(Bundle savedInstanceState) { ### 版本日志 -+ v_3.5.1 - - 优化`taskExists`方法 - - 添加`post`参数请求支持 - ```java - Aria.download(SingleTaskActivity.this) - .load(DOWNLOAD_URL) - .setFilePath(path) - .asPost() // post请求 - .setParam("key", "value") //传递参数 - //.setParams(Map) // 传递多参数 - .start(); + + v_3.5.2 + - 添加Serializable接口支持 https://github.com/AriaLyy/Aria/issues/320 + - 失败回调增加错误原因 https://github.com/AriaLyy/Aria/issues/310 ``` - - 增加强制设置文件路径的api, https://github.com/AriaLyy/Aria/issues/311 - ``` - Aria.download(SingleTaskActivity.this) - .load(DOWNLOAD_URL) - .setFilePath(path, true) // true表示忽略路径是否被占用 - .start(); - ``` + @Download.onTaskFail void taskFail(DownloadTask task, Exception e) { + e.getMessage(); + ... + } + ``` + - fix bug https://github.com/AriaLyy/Aria/issues/322 + - 新增201 重定向支持 https://github.com/AriaLyy/Aria/issues/318 + - 修复使用`useServerFileName(true)`中含有`"`导致的文件后缀名错误问题 + - 优化logcat日志提示 + - 修改下载线程的优先级为`Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);` + - fix bug https://github.com/AriaLyy/Aria/issues/319 + - 修复分卡下载失败的问题 https://github.com/AriaLyy/Aria/issues/326 + - 初始化Aria时会将所有数据库状态为下载中的任务改为已停止,防止应用被kill后,任务状态错误 + - 初始化时自动判断文件是否被删除,文件被删除的任务将自动重置默认值 + - 修复刷新url后,文件无法删除的 bug + - fix bug https://github.com/AriaLyy/Aria/issues/309 + - 优化配置文件的读取 [更多版本记录](https://github.com/AriaLyy/Aria/blob/master/DEV_LOG.md) diff --git a/app/src/main/java/com/arialyy/simple/download/SingleTaskActivity.java b/app/src/main/java/com/arialyy/simple/download/SingleTaskActivity.java index 45eff9ca..19a2b3b9 100644 --- a/app/src/main/java/com/arialyy/simple/download/SingleTaskActivity.java +++ b/app/src/main/java/com/arialyy/simple/download/SingleTaskActivity.java @@ -179,6 +179,11 @@ public class SingleTaskActivity extends BaseActivity { } } + /** + * + * @param task + * @param e + */ @Download.onTaskFail void taskFail(DownloadTask task, Exception e) { if (task.getKey().equals(DOWNLOAD_URL)) { Toast.makeText(SingleTaskActivity.this, "下载失败", Toast.LENGTH_SHORT).show(); diff --git a/build.gradle b/build.gradle index 8d36f196..5e852501 100644 --- a/build.gradle +++ b/build.gradle @@ -39,7 +39,7 @@ task clean(type: Delete) { ext { userOrg = 'arialyy' groupId = 'com.arialyy.aria' - publishVersion = '3.5.2_dev_7' + publishVersion = '3.5.2' // publishVersion = '1.0.4' //FTP插件 repoName='maven' desc = 'android 下载框架'