Suppress Eclipse warning about unclosed resource in SshSession
Change-Id: Ie3c1240ad8eda6c63042a0f111c27a40d7b411b2
This commit is contained in:
parent
7d0580bf2f
commit
f34424c6d2
@ -33,6 +33,7 @@ public class SshSession {
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
@SuppressWarnings("resource")
|
||||
public String exec(String command) throws JSchException, IOException {
|
||||
ChannelExec channel = (ChannelExec) getSession().openChannel("exec");
|
||||
try {
|
||||
@ -42,7 +43,7 @@ public class SshSession {
|
||||
channel.connect();
|
||||
|
||||
Scanner s = new Scanner(channel.getErrStream()).useDelimiter("\\A");
|
||||
error = s.hasNext() ? s.next() : null;
|
||||
error = s.hasNext() ? s.next() : null;
|
||||
|
||||
s = new Scanner(in).useDelimiter("\\A");
|
||||
return s.hasNext() ? s.next() : "";
|
||||
|
Loading…
Reference in New Issue
Block a user