SSH2ConsoleRemote.command() doesn't work with
ByteArrayOutputStream
maf at appgate.com
maf at appgate.com
Thu Nov 3 13:19:07 MET 2005
On 28 okt, Edilmar wrote:
> SSH2Transport transport = new SSH2Transport(new Socket(host, port),
> secureRandom);
> SSH2SimpleClient client = new SSH2SimpleClient(transport, user, passwd);
> SSH2ConsoleRemote console = new
> SSH2ConsoleRemote(client.getConnection(), null, System.err);
> ByteArrayOutputStream out = new ByteArrayOutputStream();
> console.command(cmdLine, out, out);
> textarea.setText(out.toString());
Add a call to console.waitForExitStatus() before retrieving the string.
The command() call returns once the command has been executed but it
does not wait for the command to complete. I'll add a note about this in
the javadocs.
/MaF
More information about the Mindterm-users
mailing list