use of ch.ethz.ssh2.Session in project Payara by payara.
the class SSHLauncher method runCommandAsIs.
private int runCommandAsIs(String command, OutputStream os, List<String> stdinLines) throws IOException, InterruptedException {
if (logger.isLoggable(Level.FINER)) {
logger.finer("Running command " + command + " on host: " + this.host);
}
openConnection();
final Session sess = connection.openSession();
int status = exec(sess, command, os, listInputStream(stdinLines));
// XXX: Should we close connection after each command or cache it
// and re-use it?
SSHUtil.unregister(connection);
connection = null;
return status;
}
Aggregations