|
|
@ -17,6 +17,7 @@ package com.arialyy.aria.core.upload.uploader; |
|
|
|
|
|
|
|
|
|
|
|
import com.arialyy.aria.core.common.IUtil; |
|
|
|
import com.arialyy.aria.core.common.IUtil; |
|
|
|
import com.arialyy.aria.core.common.OnFileInfoCallback; |
|
|
|
import com.arialyy.aria.core.common.OnFileInfoCallback; |
|
|
|
|
|
|
|
import com.arialyy.aria.core.inf.AbsTaskEntity; |
|
|
|
import com.arialyy.aria.core.inf.IUploadListener; |
|
|
|
import com.arialyy.aria.core.inf.IUploadListener; |
|
|
|
import com.arialyy.aria.core.upload.UploadEntity; |
|
|
|
import com.arialyy.aria.core.upload.UploadEntity; |
|
|
|
import com.arialyy.aria.core.upload.UploadTaskEntity; |
|
|
|
import com.arialyy.aria.core.upload.UploadTaskEntity; |
|
|
@ -47,6 +48,8 @@ public class SimpleUploadUtil implements IUtil, Runnable { |
|
|
|
|
|
|
|
|
|
|
|
@Override public void run() { |
|
|
|
@Override public void run() { |
|
|
|
mListener.onPre(); |
|
|
|
mListener.onPre(); |
|
|
|
|
|
|
|
switch (mTaskEntity.requestType) { |
|
|
|
|
|
|
|
case AbsTaskEntity.U_FTP: |
|
|
|
new FtpFileInfoThread(mTaskEntity, new OnFileInfoCallback() { |
|
|
|
new FtpFileInfoThread(mTaskEntity, new OnFileInfoCallback() { |
|
|
|
@Override public void onComplete(String url, int code) { |
|
|
|
@Override public void onComplete(String url, int code) { |
|
|
|
if (code == FtpFileInfoThread.CODE_COMPLETE) { |
|
|
|
if (code == FtpFileInfoThread.CODE_COMPLETE) { |
|
|
@ -60,6 +63,11 @@ public class SimpleUploadUtil implements IUtil, Runnable { |
|
|
|
mListener.onFail(needRetry); |
|
|
|
mListener.onFail(needRetry); |
|
|
|
} |
|
|
|
} |
|
|
|
}).start(); |
|
|
|
}).start(); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case AbsTaskEntity.U_HTTP: |
|
|
|
|
|
|
|
mUploader.start(); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override public long getFileSize() { |
|
|
|
@Override public long getFileSize() { |
|
|
|