*/
protected List<String> sshExecCmd(final String command, final SshStreams sshStream)
throws OpenShiftSSHOperationException {
final Session session = getSSHSession();
if (session == null) {
throw new OpenShiftSSHOperationException("No SSH session available for application ''{0}''", this.getName());
}
Channel channel = null;
BufferedReader reader = null;
try {
session.openChannel("exec");
channel = session.openChannel("exec");
((ChannelExec) channel).setCommand(command);
channel.connect();
return sshStream.getLines(channel);
} catch (JSchException e) {
throw new OpenShiftSSHOperationException(e, "Failed to list forwardable ports for application \"{0}\"",
this.getName());
} catch (IOException e) {
throw new OpenShiftSSHOperationException(e, "Failed to list forwardable ports for application \"{0}\"",
this.getName());
} finally {
if (reader != null) {
try {