修复ftp上传完成后,删除服务器端的文件,无法重新下载的问题

This commit is contained in:
laoyuyu
2020-01-06 19:59:17 +08:00
parent e14928e260
commit 8158c58d6e
29 changed files with 290 additions and 74 deletions

View File

@@ -91,7 +91,7 @@ public abstract class AbsFtpInfoTask<ENTITY extends AbsEntity, TASK_WRAPPER exte
}
String remotePath = CommonUtil.convertFtpChar(charSet, getRemotePath());
FTPFile[] files = client.listFiles(getRemotePath());
FTPFile[] files = client.listFiles(remotePath);
boolean isExist = files.length != 0;
if (!isExist && !isUpload) {
int i = remotePath.lastIndexOf(File.separator);
@@ -128,7 +128,11 @@ public abstract class AbsFtpInfoTask<ENTITY extends AbsEntity, TASK_WRAPPER exte
}
//为了防止编码错乱,需要使用原始字符串
mSize = getFileSize(files, client, getRemotePath());
if (isUpload && files.length == 0){
handleFile(getRemotePath(), null);
}else {
mSize = getFileSize(files, client, getRemotePath());
}
int reply = client.getReplyCode();
if (!FTPReply.isPositiveCompletion(reply)) {
if (isUpload) {