This commit is contained in:
Looly
2021-04-19 13:19:09 +08:00
parent b2cc737a82
commit 6a29172e86
2 changed files with 10 additions and 3 deletions

View File

@@ -172,8 +172,14 @@ public class Sftp extends AbstractFtp {
@Override
public Sftp reconnectIfTimeout() {
if (false == this.cd("/") && StrUtil.isNotBlank(this.ftpConfig.getHost())) {
init(this.ftpConfig);
if(StrUtil.isBlank(this.ftpConfig.getHost())){
throw new FtpException("Host is blank!");
}
try{
this.cd(StrUtil.SLASH);
} catch (FtpException e){
close();
init();
}
return this;
}