mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
修复Ftp中路径问题
This commit is contained in:
parent
d8b4aa5ec3
commit
ac3fc026e1
@ -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)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user