diff --git a/README.md b/README.md index b2fba7dc..528fd340 100644 --- a/README.md +++ b/README.md @@ -33,14 +33,14 @@ 对于Eclipse不能运行项目的,提供了apk供直接运行 -### 或者点击下载Demo [okhttputils_v1.8.0.apk](https://github.com/jeasonlzy0216/OkHttpUtils/blob/master/okhttputils_v1.8.0.apk?raw=true)。 +### 或者点击下载Demo [okhttputils_v1.8.1.apk](https://github.com/jeasonlzy0216/OkHttpUtils/blob/master/okhttputils_v1.8.1.apk?raw=true)。 本项目Demo的网络请求是我自己的服务器,有时候可能不稳定,网速比较慢时请耐心等待。。 * 对于Android Studio的用户,可以选择添加: ```java - compile 'com.lzy.net:okhttputils:1.8.0' //可以单独使用,不需要依赖下方的扩展包 - compile 'com.lzy.net:okhttpserver:1.0.2' //扩展了下载管理和上传管理,根据需要添加 + compile 'com.lzy.net:okhttputils:1.8.1' //可以单独使用,不需要依赖下方的扩展包 + compile 'com.lzy.net:okhttpserver:1.0.3' //扩展了下载管理和上传管理,根据需要添加 或者 @@ -50,8 +50,8 @@ * 对于Eclipse的用户,可以选择添加 `/jar` 目录下的: ```java - okhttputils-1.8.0.jar - okhttpserver-1.0.2.jar + okhttputils-1.8.1.jar + okhttpserver-1.0.3.jar ``` * 如果是以jar包的形式引入`okhttpserver`,需要在清单文件中额外注册一个服务 ```java diff --git a/app/build.gradle b/app/build.gradle index d432707a..a8a51275 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { applicationId "com.lzy.okhttpdemo" minSdkVersion 14 targetSdkVersion 22 - versionCode 22 - versionName "1.8.0" + versionCode 23 + versionName "1.8.1" } signingConfigs { appkey { diff --git a/jar/okhttpserver-1.0.2.jar b/jar/okhttpserver-1.0.3.jar similarity index 78% rename from jar/okhttpserver-1.0.2.jar rename to jar/okhttpserver-1.0.3.jar index 72f05584..7c7c509d 100644 Binary files a/jar/okhttpserver-1.0.2.jar and b/jar/okhttpserver-1.0.3.jar differ diff --git a/jar/okhttputils-1.8.0.jar b/jar/okhttputils-1.8.1.jar similarity index 69% rename from jar/okhttputils-1.8.0.jar rename to jar/okhttputils-1.8.1.jar index 6cf77fe7..5635597d 100644 Binary files a/jar/okhttputils-1.8.0.jar and b/jar/okhttputils-1.8.1.jar differ diff --git a/okhttpserver/bintray.gradle b/okhttpserver/bintray.gradle index 6ece7c99..7195dd2d 100644 --- a/okhttpserver/bintray.gradle +++ b/okhttpserver/bintray.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.github.dcendents.android-maven' apply plugin: 'com.jfrog.bintray' -version = "1.0.2" // 数据仓库依赖第三部分 +version = "1.0.3" // 数据仓库依赖第三部分 def siteUrl = 'https://github.com/jeasonlzy0216/OkHttpUtils' def gitUrl = 'https://github.com/jeasonlzy0216/OkHttpUtils.git' diff --git a/okhttpserver/build.gradle b/okhttpserver/build.gradle index 7feef792..d95a81de 100644 --- a/okhttpserver/build.gradle +++ b/okhttpserver/build.gradle @@ -7,14 +7,14 @@ android { defaultConfig { minSdkVersion 8 targetSdkVersion 22 - versionCode 12 - versionName "1.0.2" + versionCode 13 + versionName "1.0.3" } } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') -// compile 'com.lzy.net:okhttputils:1.8.0' +// compile 'com.lzy.net:okhttputils:1.8.1' compile project(':okhttputils') } diff --git a/okhttpserver/src/main/java/com/lzy/okhttpserver/download/DownloadManager.java b/okhttpserver/src/main/java/com/lzy/okhttpserver/download/DownloadManager.java index 1ab9be30..8cdb8a59 100644 --- a/okhttpserver/src/main/java/com/lzy/okhttpserver/download/DownloadManager.java +++ b/okhttpserver/src/main/java/com/lzy/okhttpserver/download/DownloadManager.java @@ -163,11 +163,16 @@ public void stopAllTask() { /** 删除一个任务,会删除下载文件 */ public void removeTask(String taskKey) { + removeTask(taskKey, false); + } + + /** 删除一个任务,会删除下载文件 */ + public void removeTask(String taskKey, boolean isDeleteFile) { final DownloadInfo downloadInfo = getDownloadInfo(taskKey); if (downloadInfo == null) return; pauseTask(taskKey); //暂停任务 removeTaskByKey(taskKey); //移除任务 - deleteFile(downloadInfo.getTargetPath()); //删除文件 + if (isDeleteFile) deleteFile(downloadInfo.getTargetPath()); //删除文件 DownloadDBManager.INSTANCE.delete(taskKey); //清除数据库 } diff --git a/okhttputils/bintray.gradle b/okhttputils/bintray.gradle index cc67bfd3..ae711d86 100644 --- a/okhttputils/bintray.gradle +++ b/okhttputils/bintray.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.github.dcendents.android-maven' apply plugin: 'com.jfrog.bintray' -version = "1.8.0" // 数据仓库依赖第三部分 +version = "1.8.1" // 数据仓库依赖第三部分 def siteUrl = 'https://github.com/jeasonlzy0216/OkHttpUtils' def gitUrl = 'https://github.com/jeasonlzy0216/OkHttpUtils.git' diff --git a/okhttputils/build.gradle b/okhttputils/build.gradle index f658625a..03c3bc46 100644 --- a/okhttputils/build.gradle +++ b/okhttputils/build.gradle @@ -7,8 +7,8 @@ android { defaultConfig { minSdkVersion 8 targetSdkVersion 22 - versionCode 16 - versionName "1.8.0" + versionCode 17 + versionName "1.8.1" } } diff --git a/okhttputils_v1.8.0.apk b/okhttputils_v1.8.0.apk deleted file mode 100644 index 169aff50..00000000 Binary files a/okhttputils_v1.8.0.apk and /dev/null differ diff --git a/okhttputils_v1.8.1.apk b/okhttputils_v1.8.1.apk new file mode 100644 index 00000000..ed62b8bd Binary files /dev/null and b/okhttputils_v1.8.1.apk differ