Detect File (detectFile)

<detectFile> Element

The detectFile rule is used to find files.

Table 1. <detectFile> Element Attributes
Attribute Name Type Required Description
flagMissingFile Boolean No

Indicates whether to flag when the file is missing. Defaults to false.

flagOnce Boolean No

Indicates whether to flag once per archive. Defaults to false.

flagOncePerFile Boolean No

Indicates whether to flag once per file. Defaults to false.

hideResult Boolean No

Indicates whether results flagged by this rule should be hidden in the report. This attribute only hides results when used with rules under the <and> or <or> tags. Defaults to false.

Child Elements (One or more)

<file> Element - required, can be multiple

Table 2. <file> Element Attributes
Attribute Name Type Required Description
pattern Regex Yes

File name with or without path. When flagMissingFile is true, specify the path leading up to the folders and filename.

folder String No, unless flagMissingFile is true

The name of the folder containing the file. If providing multiple, use a comma separated list.

fileName String No, unless flagMissingFile is true

The file name.

For example, to detect file with the properties file extension, specify:


<detectFile>
    <file pattern="(.*)?\.properties"/>
</detectFile>