private CommandTool getJBossCliTool() {
if (SystemUtils.IS_OS_WINDOWS) {
return Tasks.prepare(CommandTool.class)
.command(new CommandBuilder("cmd.exe"))
.parameters("/C", new File(environment.get("JBOSS_HOME"), "/bin/jboss-cli.bat").getAbsolutePath())
.addEnvironment(environment);
} else if (SystemUtils.IS_OS_LINUX || SystemUtils.IS_OS_MAC_OSX) {
return Tasks.prepare(CommandTool.class)
.command(new CommandBuilder(new File(environment.get("JBOSS_HOME"), "/bin/jboss-cli.sh").getAbsolutePath()))
.addEnvironment(environment);
} else {
throw new IllegalStateException("Unrecognized operating system.");
}
}