diff --git a/.gitignore b/.gitignore index 5edce1b..cc07bbd 100644 --- a/.gitignore +++ b/.gitignore @@ -24,10 +24,11 @@ log /target/ /log/ -/test/java/baseTest/BaseTest.java +/src/test/java/baseTest/BaseTest.java .DS_Store /src/main/resources/WEB-INF/prop/weaver.properties /lib/classbean +/file/ diff --git a/src/main/java/aiyh/utils/fileUtil/sftp/SftpConnectUtil.java b/src/main/java/aiyh/utils/fileUtil/sftp/SftpConnectUtil.java index 5456dd0..61c5d3b 100644 --- a/src/main/java/aiyh/utils/fileUtil/sftp/SftpConnectUtil.java +++ b/src/main/java/aiyh/utils/fileUtil/sftp/SftpConnectUtil.java @@ -94,7 +94,7 @@ public class SftpConnectUtil extends ChannelSftp { } else { throw new RuntimeException("从sftp下载需要的ppk文件未找到"); } - if (port > 0) { + if (port != null && port > 0) { this.session = jSch.getSession(userName, sftpIp, port); } else { this.session = jSch.getSession(userName, sftpIp); diff --git a/src/main/java/weaver/youhong/ai/pcn/hrorganization/sftp/FetchDataUtil.java b/src/main/java/weaver/youhong/ai/pcn/hrorganization/sftp/FetchDataUtil.java index 234418f..0a99315 100644 --- a/src/main/java/weaver/youhong/ai/pcn/hrorganization/sftp/FetchDataUtil.java +++ b/src/main/java/weaver/youhong/ai/pcn/hrorganization/sftp/FetchDataUtil.java @@ -2,8 +2,14 @@ package weaver.youhong.ai.pcn.hrorganization.sftp; import aiyh.utils.excention.CustomerException; import aiyh.utils.fileUtil.sftp.SftpConnectUtil; +import com.jcraft.jsch.ChannelSftp; import com.jcraft.jsch.SftpException; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.util.Vector; + /** *