mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
修复jsch session.openSftp()未打开session问题
This commit is contained in:
@@ -152,6 +152,15 @@ public class JschSftp extends AbstractFtp {
|
||||
.getRaw();
|
||||
}
|
||||
|
||||
if (false == session.isConnected()) {
|
||||
// issue#I9CH6A 首先Session需连接
|
||||
try {
|
||||
session.connect((int) this.ftpConfig.getConnector().getTimeout());
|
||||
} catch (final JSchException e) {
|
||||
throw new SshException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// 创建Channel
|
||||
try {
|
||||
this.channel = (ChannelSftp) this.session.openChannel(ChannelType.SFTP.getValue());
|
||||
|
Reference in New Issue
Block a user