diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/SFTPUtil.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/SFTPUtil.java index 6c90132c..a001f3bc 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/SFTPUtil.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/SFTPUtil.java @@ -166,7 +166,7 @@ public class SFTPUtil { try{ sftp = connect(sftpConfig); try { - directory = getDirectory(sftpConfig.getUploadpath(), directory); +// directory = getDirectory(sftpConfig.getUploadpath(), directory); sftp.cd(directory); } catch (SftpException e1) { try { @@ -386,14 +386,13 @@ public class SFTPUtil { map.put("msg", "ftp创建" + directory + "文件路径失败"); } } - Session session = null; Channel channel = null; try { String oldfullpath = sftpConfig.getFullpath().concat(oldpath); String newpath = directory.concat(newname); String newfullpath = sftpConfig.getFullpath().concat(newpath); String moveCommand = "mv " + oldfullpath + " " + newfullpath; // 移动文件的命令 - session = sftp.getSession(); + Session session = sftp.getSession(); channel = session.openChannel("exec"); ((ChannelExec) channel).setCommand(moveCommand); channel.setInputStream(null);