Specifying Files and Directories

File specifiers are expressions that allow you to pass a long list of files or a directory to Fortify Static Code AnalyzerClosedA set of software security analyzers that scan source code for violations of security-specific coding rules and guidelines for a variety of languages. The rich data provided by the language technology enables the analyzers to pinpoint and prioritize violations so that fixes can be fast and accurate. using wildcard characters. Fortify Static Code Analyzer 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.

<files> | <file_dir_specifiers>

Note: File specifiers do not apply to C, C++, or Objective-C++.

The following table describes examples of file and directory specifiers.

File / Directory Specifier Description

<dir>

<dir>/**/*

Matches all files in the named directory and any subdirectories or the named directory when used for a directory parameterClosedAn item of information, such as a name, a selection, or a number, passed to a program by another program or an end-user..

<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.

**/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

Note: 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 (/).