修复ftp服务器无法响应abor命令导致的无法停止上传的问题
修复ftp上传时,服务器有长度为0的文件导致上传失败的问题 修复下载任务和上传任务的文件路径是同一个时,导致的记录混乱问题
This commit is contained in:
@@ -55,7 +55,8 @@ public class FtpUploadActivity extends BaseActivity<ActivityFtpUploadBinding> {
|
||||
private String mUrl;
|
||||
private UploadModule mModule;
|
||||
private long mTaskId = -1;
|
||||
private String user = "lao", pwd = "123456";
|
||||
private String user = "ftpuser", pwd = "ftpuser2020";
|
||||
//private String user = "lao", pwd = "123456";
|
||||
|
||||
@Override protected void init(Bundle savedInstanceState) {
|
||||
setTile("D_FTP 文件上传");
|
||||
@@ -92,11 +93,11 @@ public class FtpUploadActivity extends BaseActivity<ActivityFtpUploadBinding> {
|
||||
}
|
||||
|
||||
private void setHelpCode() {
|
||||
try {
|
||||
getBinding().codeView.setSource(AppUtil.getHelpCode(this, "FtpUpload.java"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//try {
|
||||
// getBinding().codeView.setSource(AppUtil.getHelpCode(this, "FtpUpload.java"));
|
||||
//} catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
//}
|
||||
}
|
||||
|
||||
@Override protected int setLayoutId() {
|
||||
@@ -245,7 +246,7 @@ public class FtpUploadActivity extends BaseActivity<ActivityFtpUploadBinding> {
|
||||
@Override public FtpInterceptHandler onIntercept(UploadEntity entity, List<String> fileList) {
|
||||
FtpInterceptHandler.Builder builder = new FtpInterceptHandler.Builder();
|
||||
//builder.coverServerFile(); // 覆盖远端同名文件
|
||||
builder.resetFileName("test.zip"); //修改上传到远端服务器的文件名
|
||||
builder.resetFileName("test12.zip"); //修改上传到远端服务器的文件名
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,9 +35,12 @@ public class UploadModule extends BaseViewModule {
|
||||
* 获取Ftp上传信息
|
||||
*/
|
||||
LiveData<UploadEntity> getFtpInfo(Context context) {
|
||||
String url = AppUtil.getConfigValue(context, FTP_URL_KEY, "ftp://9.9.9.72:2121/aab/你好");
|
||||
String filePath = AppUtil.getConfigValue(context, FTP_PATH_KEY,
|
||||
Environment.getExternalStorageDirectory().getPath() + "/Download/AndroidAria.db");
|
||||
//String url = AppUtil.getConfigValue(context, FTP_URL_KEY, "ftp://9.9.9.72:2121/aab/你好");
|
||||
//String filePath = AppUtil.getConfigValue(context, FTP_PATH_KEY,
|
||||
// Environment.getExternalStorageDirectory().getPath() + "/Download/AndroidAria.db");
|
||||
String url = "ftp://101.132.33.64:21/home/ftpuser/videopic/historymonitor/jobs/test";
|
||||
//String url = "ftp://9.9.9.72:2121/aab/你好";
|
||||
String filePath = "/mnt/sdcard/QQMusic-import-1.2.1.zip";
|
||||
|
||||
UploadEntity entity = Aria.upload(context).getFirstUploadEntity(filePath);
|
||||
if (entity != null) {
|
||||
|
||||
@@ -72,11 +72,11 @@
|
||||
/>
|
||||
|
||||
|
||||
<com.arialyy.simple.widget.CodeView
|
||||
android:id="@+id/code_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
/>
|
||||
<!-- <com.arialyy.simple.widget.CodeView-->
|
||||
<!-- android:id="@+id/code_view"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- />-->
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user