private OVAL.Definitions.Unix.file_object CreateUnixFileObject(EntityObjectStringType filePath, EntityObjectStringType path, EntityObjectStringType fileName)
        {
            var fileObject = new OVAL.Definitions.Unix.file_object();

            EntityObjectStringType[] items;
            OVAL.Definitions.Unix.ItemsChoiceType3[] itemChoices;
            if (filePath != null)
            {
                items          = new EntityObjectStringType[1];
                itemChoices    = new OVAL.Definitions.Unix.ItemsChoiceType3[1];
                items[0]       = filePath;
                itemChoices[0] = OVAL.Definitions.Unix.ItemsChoiceType3.filepath;
            }
            else
            {
                items          = new EntityObjectStringType[2];
                itemChoices    = new OVAL.Definitions.Unix.ItemsChoiceType3[2];
                items[0]       = path;
                items[1]       = fileName;
                itemChoices[0] = OVAL.Definitions.Unix.ItemsChoiceType3.path;
                itemChoices[1] = OVAL.Definitions.Unix.ItemsChoiceType3.filename;
            }
            fileObject.Items            = items;
            fileObject.ItemsElementName = itemChoices;
            return(fileObject);
        }
 private OVAL.Definitions.Unix.file_object CreateUnixFileObject(EntityObjectStringType filePath, EntityObjectStringType path, EntityObjectStringType fileName)
 {
     var fileObject = new OVAL.Definitions.Unix.file_object();
     EntityObjectStringType[] items;
     OVAL.Definitions.Unix.ItemsChoiceType3[] itemChoices;
     if (filePath != null)
     {
         items = new EntityObjectStringType[1];
         itemChoices = new OVAL.Definitions.Unix.ItemsChoiceType3[1];
         items[0] = filePath;
         itemChoices[0] = OVAL.Definitions.Unix.ItemsChoiceType3.filepath;
     }
     else
     {
         items = new EntityObjectStringType[2];
         itemChoices = new OVAL.Definitions.Unix.ItemsChoiceType3[2];
         items[0] = path;
         items[1] = fileName;
         itemChoices[0] = OVAL.Definitions.Unix.ItemsChoiceType3.path;
         itemChoices[1] = OVAL.Definitions.Unix.ItemsChoiceType3.filename;
     }
     fileObject.Items = items;
     fileObject.ItemsElementName = itemChoices;
     return fileObject;
 }
Exemple #3
0
        private IEnumerable <String> evaluateVariableForFileEntity(OVAL.Definitions.Unix.file_object fileObject, OVAL.Definitions.Unix.ItemsChoiceType3 fileObjectEntityItem)
        {
            var fileObjectEntity = (EntityObjectStringType)fileObject.GetItemValue(fileObjectEntityItem);
            var evaluatedEntity  = this.FilePathVarEvaluator.EvaluateEntityVariable(fileObjectEntity);

            return(evaluatedEntity == null ? null : evaluatedEntity.Distinct().ToArray());
        }