From 472006ef61d3924f693a555de669974fb47c31e8 Mon Sep 17 00:00:00 2001 From: laoyuyu <511455842@qq.com> Date: Tue, 18 Feb 2020 23:16:47 +0800 Subject: [PATCH] 3.8.6 --- DEV_LOG.md | 1 + .../aria/http/download/HttpDFileInfoTask.java | 17 +++++---- README.md | 37 +++++++++++-------- build.gradle | 4 +- 4 files changed, 34 insertions(+), 25 deletions(-) diff --git a/DEV_LOG.md b/DEV_LOG.md index 21fe4ff5..f7a2cc03 100644 --- a/DEV_LOG.md +++ b/DEV_LOG.md @@ -4,6 +4,7 @@ - fix bug https://github.com/AriaLyy/Aria/issues/579#issuecomment-586665035 - fix bug https://github.com/AriaLyy/Aria/issues/610 - fix bug https://github.com/AriaLyy/Aria/issues/614 + - 增加文件名适配器(感谢小伙伴[DaveBoy](https://github.com/DaveBoy)的PR) - 优化异常提示 + v_3.8.5 (2020/1/18) - fix bug https://github.com/AriaLyy/Aria/issues/599 diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDFileInfoTask.java b/HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDFileInfoTask.java index 49ef09ad..a4e85d24 100644 --- a/HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDFileInfoTask.java +++ b/HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDFileInfoTask.java @@ -91,7 +91,7 @@ final class HttpDFileInfoTask implements IInfoTask, Runnable { if (conn != null) { try { InputStream is = conn.getInputStream(); - if (is != null){ + if (is != null) { is.close(); } } catch (IOException e) { @@ -158,15 +158,16 @@ final class HttpDFileInfoTask implements IInfoTask, Runnable { if (!TextUtils.isEmpty(disposition)) { mEntity.setDisposition(CommonUtil.encryptBASE64(disposition)); handleContentDisposition(disposition); - } else{ - if(taskOption.getFileNameAdapter()!=null) { - String newName =taskOption.getFileNameAdapter().handleFileName(headers,mEntity.getKey()); + } else { + if (taskOption.getFileNameAdapter() != null) { + String newName = + taskOption.getFileNameAdapter().handleFileName(headers, mEntity.getKey()); mEntity.setServerFileName(newName); renameFile(newName); - }else if(conn.getHeaderField("Content-Type")!=null){ - String contentType=conn.getHeaderField("Content-Type"); - String type=contentType.substring(contentType.indexOf(File.separator)+1); - String newName =mEntity.getFileName()+File.separator+type; + } else if (conn.getHeaderField("Content-Type") != null) { + String contentType = conn.getHeaderField("Content-Type"); + String type = contentType.substring(contentType.indexOf(File.separator) + 1); + String newName = String.format("%s.%s", mEntity.getFileName(), type); mEntity.setServerFileName(newName); renameFile(newName); } diff --git a/README.md b/README.md index 12fe87b9..ba457017 100644 --- a/README.md +++ b/README.md @@ -45,19 +45,19 @@ Aria有以下特点: ## 引入库 [![license](http://img.shields.io/badge/license-Apache2.0-brightgreen.svg?style=flat)](https://github.com/AriaLyy/Aria/blob/master/LICENSE) -[![Core](https://img.shields.io/badge/Core-3.8.5-blue)](https://github.com/AriaLyy/Aria) -[![Compiler](https://img.shields.io/badge/Compiler-3.8.5-blue)](https://github.com/AriaLyy/Aria) -[![FtpComponent](https://img.shields.io/badge/FtpComponent-3.8.5-orange)](https://github.com/AriaLyy/Aria) -[![FtpComponent](https://img.shields.io/badge/SFtpComponent-3.8.5-orange)](https://github.com/AriaLyy/Aria) -[![M3U8Component](https://img.shields.io/badge/M3U8Component-3.8.5-orange)](https://github.com/AriaLyy/Aria) +[![Core](https://img.shields.io/badge/Core-3.8.6-blue)](https://github.com/AriaLyy/Aria) +[![Compiler](https://img.shields.io/badge/Compiler-3.8.6-blue)](https://github.com/AriaLyy/Aria) +[![FtpComponent](https://img.shields.io/badge/FtpComponent-3.8.6-orange)](https://github.com/AriaLyy/Aria) +[![FtpComponent](https://img.shields.io/badge/SFtpComponent-3.8.6-orange)](https://github.com/AriaLyy/Aria) +[![M3U8Component](https://img.shields.io/badge/M3U8Component-3.8.6-orange)](https://github.com/AriaLyy/Aria) ```java -implementation 'com.arialyy.aria:core:3.8.5' -annotationProcessor 'com.arialyy.aria:compiler:3.8.5' -implementation 'com.arialyy.aria:ftpComponent:3.8.5' # 如果需要使用ftp,请增加该组件 -implementation 'com.arialyy.aria:sftpComponent:3.8.5' # 如果需要使用ftp,请增加该组件 -implementation 'com.arialyy.aria:m3u8Component:3.8.5' # 如果需要使用m3u8下载功能,请增加该组件 +implementation 'com.arialyy.aria:core:3.8.6' +annotationProcessor 'com.arialyy.aria:compiler:3.8.6' +implementation 'com.arialyy.aria:ftpComponent:3.8.6' # 如果需要使用ftp,请增加该组件 +implementation 'com.arialyy.aria:sftpComponent:3.8.6' # 如果需要使用ftp,请增加该组件 +implementation 'com.arialyy.aria:m3u8Component:3.8.6' # 如果需要使用m3u8下载功能,请增加该组件 ``` 如果你使用的是kotlin,请使用kotlin官方提供的方法配置apt,[kotlin kapt官方配置传送门](https://www.kotlincn.net/docs/reference/kapt.html) @@ -138,11 +138,13 @@ protected void onCreate(Bundle savedInstanceState) { ### 版本日志 -+ v_3.8.5 (2020/1/18) - - fix bug https://github.com/AriaLyy/Aria/issues/599 - - 增加密钥url转换器的参数 https://github.com/AriaLyy/Aria/issues/603 - - 增加sftp,文件上传、下载功能,[sftp下载](https://aria.laoyuyu.me/aria_doc/download/sftp_normal.html),[sftp上传](https://aria.laoyuyu.me/aria_doc/upload/sftp_normal.html) - - 使用零拷贝技术,优化了合并分块的效率 ++ v_3.8.6 (2020/2/18) + - fix bug https://github.com/AriaLyy/Aria/issues/608 + - fix bug https://github.com/AriaLyy/Aria/issues/579#issuecomment-586665035 + - fix bug https://github.com/AriaLyy/Aria/issues/610 + - fix bug https://github.com/AriaLyy/Aria/issues/614 + - 增加文件名适配器(感谢小伙伴[DaveBoy](https://github.com/DaveBoy)的PR) + - 优化异常提示 [更多版本记录](https://github.com/AriaLyy/Aria/blob/master/DEV_LOG.md) @@ -161,6 +163,11 @@ protected void onCreate(Bundle savedInstanceState) { ``` +## 感谢 +感谢小伙伴们提供的PR ``^_^` +[DaveBoy](https://github.com/DaveBoy) +[liuxiaowei](https://github.com/liuxiaowei) + ## 其他 有任何问题,可以在[issues](https://github.com/AriaLyy/Aria/issues)给我留言反馈。
在提交问题前,希望你已经查看过[wiki](https://aria.laoyuyu.me/aria_doc/)或搜索过[issues](https://github.com/AriaLyy/Aria/issues)。
diff --git a/build.gradle b/build.gradle index 90064a0d..d3a5f112 100644 --- a/build.gradle +++ b/build.gradle @@ -44,8 +44,8 @@ task clean(type: Delete) { } ext { - versionCode = 385 - versionName = '3.8.5' + versionCode = 386 + versionName = '3.8.6' userOrg = 'arialyy' groupId = 'com.arialyy.aria' publishVersion = versionName