From 631017bb67388baccbcd8b4ad3fe61e5e6192b63 Mon Sep 17 00:00:00 2001 From: laoyuyu <511455842@qq.com> Date: Thu, 31 Jan 2019 21:04:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dftp=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=B9=E4=B8=8B=E8=BD=BD=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../download/group/FtpDirDownloadUtil.java | 3 +- .../core/download/group/FtpDirInfoThread.java | 1 + .../download/group/SubDownloadLoader.java | 36 ++++++++++++------- .../arialyy/aria/core/inf/ITaskWrapper.java | 12 +++---- .../core/upload/uploader/FtpThreadTask.java | 1 - .../simple/download/FtpDownloadActivity.java | 2 +- .../group/FTPDirDownloadActivity.java | 2 +- .../simple/upload/FtpUploadActivity.java | 1 - 8 files changed, 34 insertions(+), 24 deletions(-) diff --git a/Aria/src/main/java/com/arialyy/aria/core/download/group/FtpDirDownloadUtil.java b/Aria/src/main/java/com/arialyy/aria/core/download/group/FtpDirDownloadUtil.java index e04ce09b..ecb73e44 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/download/group/FtpDirDownloadUtil.java +++ b/Aria/src/main/java/com/arialyy/aria/core/download/group/FtpDirDownloadUtil.java @@ -23,7 +23,8 @@ import com.arialyy.aria.core.inf.IEntity; import com.arialyy.aria.exception.BaseException; /** - * Created by Aria.Lao on 2017/7/27. ftp文件夹下载工具 + * Created by Aria.Lao on 2017/7/27. + * ftp文件夹下载工具 */ public class FtpDirDownloadUtil extends AbsGroupUtil { private String TAG = "FtpDirDownloadUtil"; diff --git a/Aria/src/main/java/com/arialyy/aria/core/download/group/FtpDirInfoThread.java b/Aria/src/main/java/com/arialyy/aria/core/download/group/FtpDirInfoThread.java index b9e3ab4c..7f8be3c1 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/download/group/FtpDirInfoThread.java +++ b/Aria/src/main/java/com/arialyy/aria/core/download/group/FtpDirInfoThread.java @@ -69,6 +69,7 @@ class FtpDirInfoThread extends AbsFtpInfoThread { /** * HTTP单任务载 */ - int D_HTTP = 0x11; + int D_HTTP = 1; /** * HTTP任务组下载 */ - int DG_HTTP = 0x12; + int DG_HTTP = 2; /** * FTP单文件下载 */ - int D_FTP = 0x13; + int D_FTP = 3; /** * FTP文件夹下载,为避免登录过多,子任务由单线程进行处理 */ - int D_FTP_DIR = 0x14; + int D_FTP_DIR = 4; /** * HTTP单文件上传 */ - int U_HTTP = 0xA1; + int U_HTTP = 5; /** * FTP单文件上传 */ - int U_FTP = 0xA2; + int U_FTP = 6; ENTITY getEntity(); } diff --git a/Aria/src/main/java/com/arialyy/aria/core/upload/uploader/FtpThreadTask.java b/Aria/src/main/java/com/arialyy/aria/core/upload/uploader/FtpThreadTask.java index 88eddc5d..06c929f2 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/upload/uploader/FtpThreadTask.java +++ b/Aria/src/main/java/com/arialyy/aria/core/upload/uploader/FtpThreadTask.java @@ -141,7 +141,6 @@ class FtpThreadTask extends AbsFtpThreadTask { * 上传 * * @return {@code true}上传成功、{@code false} 上传失败 - * @throws IOException */ private boolean upload(final FTPClient client, final BufferedRandomAccessFile bis) throws IOException { diff --git a/app/src/main/java/com/arialyy/simple/download/FtpDownloadActivity.java b/app/src/main/java/com/arialyy/simple/download/FtpDownloadActivity.java index 45fca4fd..74bffff4 100644 --- a/app/src/main/java/com/arialyy/simple/download/FtpDownloadActivity.java +++ b/app/src/main/java/com/arialyy/simple/download/FtpDownloadActivity.java @@ -64,7 +64,7 @@ public class FtpDownloadActivity extends BaseActivity { - private static final String dir = "ftp://192.168.1.2:21/upload/测试"; + private static final String dir = "ftp://9.9.9.50:21/upload/测试"; @Bind(R.id.child_list) SubStateLinearLayout mChildList; diff --git a/app/src/main/java/com/arialyy/simple/upload/FtpUploadActivity.java b/app/src/main/java/com/arialyy/simple/upload/FtpUploadActivity.java index ff55fdf4..5bd4c6b9 100644 --- a/app/src/main/java/com/arialyy/simple/upload/FtpUploadActivity.java +++ b/app/src/main/java/com/arialyy/simple/upload/FtpUploadActivity.java @@ -43,7 +43,6 @@ public class FtpUploadActivity extends BaseActivity { super.init(savedInstanceState); Aria.upload(this).register(); UploadEntity entity = Aria.upload(this).getUploadEntity(FILE_PATH); - ALog.d(TAG, "pare = >" + entity.getPercent()); if (entity != null) { getBinding().setFileSize(CommonUtil.formatFileSize(entity.getFileSize())); getBinding().setProgress(entity.isComplete() ? 100