feat:日志管理切换工作路径后设置被动模式

This commit is contained in:
qiaoqinzheng 2023-05-25 11:21:55 +08:00
parent 9c7be4c981
commit 1ff408dcb6
2 changed files with 3 additions and 0 deletions

View File

@ -117,6 +117,7 @@ public class FTPUtil {
ftpClient.changeWorkingDirectory(workPath);
}
}
ftpClient.enterLocalPassiveMode();
ftpClient.setFileType(FTPClient.BINARY_FILE_TYPE);
// 设置编码当文件中存在中文且上传后文件乱码时可使用此配置项
ftpClient.setControlEncoding(encoding);

View File

@ -40,6 +40,7 @@ public class LogManageController {
}
//切换工作文件路径
ftpClient.changeWorkingDirectory(workPath);
ftpClient.enterLocalPassiveMode();
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listDirectories());
if (CollectionUtils.isNotEmpty(ftpFiles)){
int num =1;
@ -122,6 +123,7 @@ public class LogManageController {
ftpClient.changeWorkingDirectory(workPath);
}
}
ftpClient.enterLocalPassiveMode();
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
if (CollectionUtils.isNotEmpty(ftpFiles)){
for (FTPFile ftpFile:ftpFiles) {