|
@@ -3,7 +3,6 @@ package com.steerinfo.ftp.uploadfile.utils;
|
|
import com.steerinfo.framework.utils.io.IOUtils;
|
|
import com.steerinfo.framework.utils.io.IOUtils;
|
|
import com.steerinfo.framework.utils.text.Charsets;
|
|
import com.steerinfo.framework.utils.text.Charsets;
|
|
import org.apache.commons.net.ftp.*;
|
|
import org.apache.commons.net.ftp.*;
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
@@ -33,24 +32,26 @@ public class FtpFileUtil {
|
|
* ftp服务器ip地址
|
|
* ftp服务器ip地址
|
|
* 相关配置放在application.properties 中
|
|
* 相关配置放在application.properties 中
|
|
*/
|
|
*/
|
|
- @Value("${custom.config.file-server.ip}")
|
|
|
|
- String FTP_ADDRESS;
|
|
|
|
|
|
+ //@Value("${custom.config.file-server.ip}")
|
|
|
|
+ // String FTP_ADDRESS;
|
|
|
|
+ private String FTP_ADDRESS="172.16.90.238";
|
|
|
|
|
|
/**
|
|
/**
|
|
* 端口号
|
|
* 端口号
|
|
*/
|
|
*/
|
|
- @Value("${custom.config.file-server.port}")
|
|
|
|
- Integer FTP_PORT;
|
|
|
|
|
|
+ //@Value("${custom.config.file-server.port}")
|
|
|
|
+ //Integer FTP_PORT;
|
|
|
|
+ private Integer FTP_PORT=21;
|
|
/**
|
|
/**
|
|
* 用户名
|
|
* 用户名
|
|
*/
|
|
*/
|
|
- @Value("${custom.config.file-ftp-user}")
|
|
|
|
- String FTP_USERNAME;
|
|
|
|
|
|
+ //@Value("${custom.config.file-ftp-user}")
|
|
|
|
+ private String FTP_USERNAME="ftptest";
|
|
/**
|
|
/**
|
|
* 密码
|
|
* 密码
|
|
*/
|
|
*/
|
|
- @Value("${custom.config.file-ftp-password}")
|
|
|
|
- String FTP_PASSWORD;
|
|
|
|
|
|
+ //@Value("${custom.config.file-ftp-password}")
|
|
|
|
+ private String FTP_PASSWORD="at286315";
|
|
|
|
|
|
private FTPClient ftpClient = new FTPClient();
|
|
private FTPClient ftpClient = new FTPClient();
|
|
private static final String SPOT = ".";
|
|
private static final String SPOT = ".";
|