diff --git a/CHANGELOG.md b/CHANGELOG.md index 0583d2bd6..f9d6cd7d5 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ * 【core 】 修复ObjectUtil.defaultIfXXX中NPE问题(pr#2603@Github) * 【db 】 修复Hive2驱动无法识别问题(issue#2606@Github) * 【core 】 修复computeIfAbsent问题(issue#I5PTN3@Gitee) +* 【extra 】 修复Ftp中路径问题(issue#I5R2DE@Gitee) ------------------------------------------------------------------------------------------------------------- diff --git a/hutool-extra/src/main/java/cn/hutool/extra/ftp/Ftp.java b/hutool-extra/src/main/java/cn/hutool/extra/ftp/Ftp.java index 05182e6b5..0045b451a 100755 --- a/hutool-extra/src/main/java/cn/hutool/extra/ftp/Ftp.java +++ b/hutool-extra/src/main/java/cn/hutool/extra/ftp/Ftp.java @@ -375,7 +375,7 @@ public class Ftp extends AbstractFtp { String pwd = null; if (StrUtil.isNotBlank(path)) { pwd = pwd(); - if (false == isDir(path)) { + if (false == cd(path)) { throw new FtpException("Change dir to [{}] error, maybe path not exist!", path); } } @@ -439,7 +439,7 @@ public class Ftp extends AbstractFtp { final String pwd = pwd(); final String fileName = FileUtil.getName(path); final String dir = StrUtil.removeSuffix(path, fileName); - if (false == isDir(dir)) { + if (false == cd(dir)) { throw new FtpException("Change dir to [{}] error, maybe dir not exist!", path); } @@ -557,7 +557,7 @@ public class Ftp extends AbstractFtp { if (StrUtil.isNotBlank(destPath)) { mkDirs(destPath); - if (false == isDir(destPath)) { + if (false == cd(destPath)) { throw new FtpException("Change dir to [{}] error, maybe dir not exist!", destPath); } } @@ -665,7 +665,7 @@ public class Ftp extends AbstractFtp { pwd = pwd(); } - if (false == isDir(path)) { + if (false == cd(path)) { throw new FtpException("Change dir to [{}] error, maybe dir not exist!", path); }