Package scap.check.content

Examples of scap.check.content.FileResultContent


        if (exitCode != 0 || resultFile.canRead() == false) {
          log.error("execution of OCILQI failed for content: " + getSourceContext().getId());
          result = new OCILResult(this, "Execution of OCILQI failed with error code:"
                  + exitCode);
        } else {
          FileResultContent resultContent = new FileResultContent(resultFile);
          resultContext.setResultContent(resultContent);

          result = new OCILResult(this, resultContext);
        }
      } catch (FileNotFoundException ex) {
View Full Code Here


            OvalVariablesDocument variablesDocument = getVariablesDocument(getExports(), config);
            if (variablesDocument != null) {
          File variablesFile = resultContext.getAuxiliaryFile("oval-variables_", ".xml");
                variablesDocument.save( variablesFile, new XmlOptions().setSavePrettyPrint() );
                exec.setExternalVariableFile( variablesFile );
                variablesDocumentContent = new FileResultContent(variablesFile);
            }

            Set<String> defList = getCheckedDefinitions();
            if (!defList.isEmpty()) {
                EvalutationDefinitionIdsDocument evaluatedDefinitionsDocument = getEvaluatedDefinitionsDocument(defList);
                if (evaluatedDefinitionsDocument != null) {
                    File evaluatedDefinitionsFile = resultContext.getAuxiliaryFile("oval-evaluation-ids_", ".xml");
                    evaluatedDefinitionsDocument.save(evaluatedDefinitionsFile, new XmlOptions().setSavePrettyPrint());
                    exec.setExternalEvaluatedDefinitionsFile(evaluatedDefinitionsFile);
                    evaluationIdsDocumentContent = new FileResultContent(evaluatedDefinitionsFile);
                }
            }

            OVALDirectives directives = (OVALDirectives)config.getDirective(getCheckSystem().getSystem());
            if (directives != null) {
              File directivesFile = resultContext.getAuxiliaryFile("oval-directives_", ".xml");
              XmlObject content = directives.getContent(config);
              content.save(directivesFile, new XmlOptions().setSavePrettyPrint());
                exec.setDirectivesFile(directivesFile);
                directivesContent = new FileResultContent(directivesFile);

                // Handle suppression of systems characteristics
                if (directives.isSuppressSystemsCharacteristics()) {
                  // TODO: P4: implement XSL to remove item data using -t and -x
                }
            }

            int exitCode = exec.exec(getCheckSystem(), config, System.out);
            if ( exitCode != 0 || resultFile.canRead() == false ) {
              log.error("execution of OVALDI failed for content: " + getSourceContext().getId());
                result = new OVALResult(this, "Execution of OVALDI failed with error code: "+exitCode);
            } else {
        FileResultContent resultContent = new FileResultContent(resultFile);
        resultContext.setResultContent(resultContent);

              result = new OVALResult(this, resultContext);
            }
        } catch ( FileNotFoundException ex ) {
View Full Code Here

TOP

Related Classes of scap.check.content.FileResultContent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.