String ovalDir = checkSystem.getPropertyValue(config, OVALCheckSystem.PROP_OVAL_DIR);
String ovalBin = checkSystem.getPropertyValue(config, OVALCheckSystem.PROP_OVAL_BIN);
StaticFileExecutionStrategy executionStrategy = new StaticFileExecutionStrategy(new File(ovalDir), ovalBin);
String executable = executionStrategy.getExecutableFile().getCanonicalPath();
FileExecutor executor = new FileExecutor(executionStrategy);
// executor.setRedirectErrorStream( this.outputInfoAndErrorsToSTDOUT );
executor.setRedirectErrorStream(true);
List<String> arguments = buildArgumentList();
if (log.isDebugEnabled()) {
StringBuilder builder = new StringBuilder();
builder.append(executable);
if (!arguments.isEmpty()) {
for (String argument : arguments) {
builder.append(" ");
builder.append(argument);
}
}
log.debug("Invoking OVALDI using: " + builder.toString());
}
Process p = executor.execute(arguments);
String processName = ovalBin + " : " + this.getDefinitionXmlFile().getName();
IORedirect ioRedirect = new IORedirect( p.getInputStream(), out, outputInfoAndErrorsToSTDOUT );
ioRedirect.setProcessName( processName );