mirror of
https://github.com/zfile-dev/zfile.git
synced 2025-04-19 05:34:52 +00:00
🐛 修复 FTP 模式在 Linux 环境下无法正常读取的 BUG
This commit is contained in:
@@ -13,7 +13,6 @@ import im.zhaojun.zfile.service.base.BaseFileService;
|
||||
import im.zhaojun.zfile.util.StringUtils;
|
||||
import lombok.SneakyThrows;
|
||||
import org.apache.commons.net.ftp.FTP;
|
||||
import org.apache.commons.net.ftp.FTPClientConfig;
|
||||
import org.apache.commons.net.ftp.FTPFile;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
@@ -65,7 +64,6 @@ public class FtpServiceImpl extends AbstractBaseFileService implements BaseFileS
|
||||
isInitialized = false;
|
||||
} else {
|
||||
ftp = new Ftp(host, Integer.parseInt(port), username, password, StandardCharsets.UTF_8);
|
||||
ftp.getClient().configure(new FTPClientConfig(FTPClientConfig.SYST_UNIX));
|
||||
ftp.getClient().type(FTP.BINARY_FILE_TYPE);
|
||||
testConnection();
|
||||
isInitialized = true;
|
||||
@@ -83,7 +81,6 @@ public class FtpServiceImpl extends AbstractBaseFileService implements BaseFileS
|
||||
ftpFiles = ftp.getClient().listFiles(fullPath);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
// ignore
|
||||
}
|
||||
|
||||
List<FileItemDTO> fileItemList = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user