fix Sftp bug

This commit is contained in:
Looly 2021-05-08 10:44:07 +08:00
parent 79e7fe93f6
commit cef68b6bde
2 changed files with 10 additions and 1 deletions

View File

@ -13,6 +13,7 @@
* 【core 】 修复createScheduledExecutor单位不是毫秒的问题issue#I3OYIW@Gitee
* 【core 】 修复Tailer无stop问题issue#I3PQLQ@Gitee
* 【core 】 修复空白excel读取报错问题issue#1552@Github
* 【extra 】 修复Sftp.mkDirs报错问题issue#1536@Github
-------------------------------------------------------------------------------------------------------------

View File

@ -130,7 +130,15 @@ public abstract class AbstractFtp implements Closeable {
}
for (String s : dirs) {
if (StrUtil.isNotEmpty(s)) {
if (false == cd(s)) {
boolean exist = true;
try{
if (false == cd(s)) {
exist = false;
}
} catch (FtpException e){
exist = false;
}
if(false == exist){
//目录不存在时创建
mkdir(s);
cd(s);