Specifying files and directories

File specifiers are expressions that allow you to pass a long list of files or a directory to OpenText SAST using wildcard characters. OpenText SAST recognizes two types of wildcard characters: a single asterisk character (*) matches part of a file name, and double asterisk characters (**) recursively matches directories. You can specify one or more files, one or more file specifiers, or a combination of files and file specifiers. Separate multiple file specifiers with semicolons (Windows) or colons (non-Windows).

<files> | <file_dir_specifiers>

Windows and many Linux shells automatically expand parameters that contain the asterisk character (*), so you must enclose file-specifier expressions in quotes. Also, on Windows, you can use the backslash character (\) as the directory separator instead of the forward slash (/).

Note: File specifiers do not apply to languages that require compiler or build integration.

The following table describes examples of file and directory specifiers.

File or directory specifier Description

<dir>

"<dir>/**/*"

Matches all files in the named directory and any subdirectories or the named directory when used for a directory parameter.

"<dir>/**/Example.java"

Matches any file named Example.java found in the named directory or any subdirectories.

"<dir>/*.java"

"<dir>/*.jar"

Matches any file with the specified extension found in the named directory.

"<dir>/**/*.kt"

"<dir>/**/*.jar"

Matches any file with the specified extension found in the named directory or any subdirectories.

"<dir>/**/beta/**"

Matches all directories and files found in the named directory that have beta in the path, including beta as a file name.

"<dir>/**/classes/"

Matches all directories and files with the name classes found in the named directory and any subdirectories.

"**/test/**"

Matches all files in the current directory tree that have a test element in the path, including test as a file name.

"**/test/**/*;**/build/**/*"

or

"**/test/**/*:**/build/**/*"

Matches all files in the current directory tree that have a test or a build element in the path, including test or build as a file name.

"**/webgoat/*"

Matches all files in any webgoat directory in the current directory tree.

Matches:

  • /src/main/java/org/owasp/webgoat
  • /test/java/org/owasp/webgoat

Does not match (assignments directory does not match)

  • /test/java/org/owasp/webgoat/assignments