|
@@ -58,9 +58,10 @@ public class AttachmentFileUtil {
|
|
|
try {
|
|
|
ftpClient = new FTPClient();
|
|
|
// 连接到FTP服务器
|
|
|
- Map<String, String> conf = CommonHelperUtils.getCommonParams("ftp");
|
|
|
+ Map<String, String> conf = CommonHelperUtils.getCommonParams("FTP");
|
|
|
ftpClient.connect(conf.get("IP"), Integer.parseInt(conf.get("PORT")));
|
|
|
ftpClient.login(conf.get("USER"), conf.get("PASSWD"));
|
|
|
+ logger.info("FTP:"+conf.get("USER")+conf.get("PASSWD")+conf.get("IP")+conf.get("PORT"));
|
|
|
if(!FTPReply.isPositiveCompletion(ftpClient.getReplyCode())){
|
|
|
ftpClient.disconnect();
|
|
|
return null;
|
|
@@ -72,14 +73,15 @@ public class AttachmentFileUtil {
|
|
|
fileUrl = encode(fileUrl,"UTF-8");
|
|
|
logger.info("fileUrl:" + fileUrl);
|
|
|
String dir = ftpClient.printWorkingDirectory();
|
|
|
- System.out.println(dir);
|
|
|
+ //System.out.println(dir);
|
|
|
//ftpClient.changeWorkingDirectory("Files/CMB");
|
|
|
- System.out.println(ftpClient.printWorkingDirectory());
|
|
|
+ //System.out.println(ftpClient.printWorkingDirectory());
|
|
|
+ logger.info("FTP当前目录:"+ftpClient.printWorkingDirectory());
|
|
|
//fileUrl = dir + fileUrl;
|
|
|
|
|
|
inputStream = ftpClient.retrieveFileStream(fileUrl);
|
|
|
logger.info("inputStream -- size:"+inputStream.available());
|
|
|
- System.out.println("inputStream:"+inputStream);
|
|
|
+ //System.out.println("inputStream:"+inputStream);
|
|
|
|
|
|
outStream = new ByteArrayOutputStream();
|
|
|
byte[] buffer = new byte[1024];
|