Additions:
shell.getEnv().setStdout( output_stream );
shell.getEnv().setStderr( error_stream);
shell.getEnv().setStderr( error_stream);
Deletions:
shell.getEnv().setStderr( new StreamOutputPort( error_stream,false) );
Additions:
If you want to avoid having xmlsh inherit the system streams then you need to create an instance of the Shell specifying false for the constructor. You can specify your own ports for in/out/error as well.
Shell shell = new Shell(false);
shell.getEnv().setStdout( new StreamOutputPort( output_stream ,false) );
shell.getEnv().setStderr( new StreamOutputPort( error_stream,false) );
shell.getEnv().setStdin( input_stream );
int ret = cmd.run(shell , "xmlsh" , vargs);
Shell shell = new Shell(false);
shell.getEnv().setStdout( new StreamOutputPort( output_stream ,false) );
shell.getEnv().setStderr( new StreamOutputPort( error_stream,false) );
shell.getEnv().setStdin( input_stream );
int ret = cmd.run(shell , "xmlsh" , vargs);
Additions:
The easiest way to embed xmlsh is to create an instance of xmlsh command and execute it.
xmlsh will inherit System.in, System.out and System.err from the current JVM which becomes stdin, stdout and stderr.
xmlsh will inherit System.in, System.out and System.err from the current JVM which becomes stdin, stdout and stderr.
Deletions:
Additions:
class myclass {
}
}