added braces (#9972)
This commit is contained in:
parent
74efd2530e
commit
8278cc272a
@ -32,7 +32,7 @@ public class SshdDemo {
|
||||
.getSession()) {
|
||||
session.addPasswordIdentity(password);
|
||||
session.auth()
|
||||
.verify(5L, TimeUnit.SECONDS);
|
||||
.verify(defaultTimeoutSeconds, TimeUnit.SECONDS);
|
||||
try (ByteArrayOutputStream responseStream = new ByteArrayOutputStream();
|
||||
ByteArrayOutputStream errorResponseStream = new ByteArrayOutputStream();
|
||||
ClientChannel channel = session.createChannel(Channel.CHANNEL_SHELL)) {
|
||||
|
@ -42,10 +42,12 @@ public class JschDemo {
|
||||
throw new Exception(errorResponse);
|
||||
}
|
||||
} finally {
|
||||
if (session != null)
|
||||
if (session != null) {
|
||||
session.disconnect();
|
||||
if (channel != null)
|
||||
}
|
||||
if (channel != null) {
|
||||
channel.disconnect();
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user