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

@@ -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);