try {
OSProcessHandler osph = new OSProcessHandler(builder.start(), StringUtil.join(stopCommand, " "));
osph.addProcessListener(new ProcessAdapter() {
@Override
public void onTextAvailable(final ProcessEvent event, Key outputType) {
ConsoleViewContentType contentType = ConsoleViewContentType.SYSTEM_OUTPUT;
if (outputType == ProcessOutputTypes.STDERR) {
contentType = ConsoleViewContentType.ERROR_OUTPUT;
}
console.print(event.getText(), contentType);
}