From 946aade3876b3a334a05cb76d22a65b06f3b1af5 Mon Sep 17 00:00:00 2001 From: AriaLyy <511455842@qq.com> Date: Wed, 1 Mar 2017 18:07:59 +0800 Subject: [PATCH] bug fix --- .../main/java/com/arialyy/aria/core/upload/UploadUtil.java | 5 +++-- .../main/java/com/arialyy/simple/upload/UploadActivity.java | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Aria/src/main/java/com/arialyy/aria/core/upload/UploadUtil.java b/Aria/src/main/java/com/arialyy/aria/core/upload/UploadUtil.java index 916ed0f3..702c2ba7 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/upload/UploadUtil.java +++ b/Aria/src/main/java/com/arialyy/aria/core/upload/UploadUtil.java @@ -122,8 +122,8 @@ final class UploadUtil implements Runnable { } private void fail() { - mWriter.flush(); - mWriter.close(); + //mWriter.flush(); + //mWriter.close(); mListener.onFail(); } @@ -180,6 +180,7 @@ final class UploadUtil implements Runnable { } mOutputStream.flush(); + mOutputStream.close(); inputStream.close(); mWriter.append(LINE_END); mWriter.flush(); diff --git a/app/src/main/java/com/arialyy/simple/upload/UploadActivity.java b/app/src/main/java/com/arialyy/simple/upload/UploadActivity.java index 82010b09..74021577 100644 --- a/app/src/main/java/com/arialyy/simple/upload/UploadActivity.java +++ b/app/src/main/java/com/arialyy/simple/upload/UploadActivity.java @@ -45,11 +45,11 @@ public class UploadActivity extends BaseActivity { break; case RUNNING: int p = (int) (task.getCurrentProgress() * 100 / task.getFileSize()); - L.d(TAG, "p ==> " + p); mPb.setProgress(p); break; case COMPLETE: T.showShort(UploadActivity.this, "上传完成"); + mPb.setProgress(100); break; } } @@ -62,7 +62,7 @@ public class UploadActivity extends BaseActivity { @OnClick(R.id.upload) void upload() { Aria.upload(this) .load(FILE_PATH) - .setUploadUrl("http://172.18.104.50:8080/UploadActivity/sign_file") + .setUploadUrl("http://172.18.104.50:8080/upload/sign_file") .setAttachment("file") .start(); }