Specifying File-Matching Criteria in the Import REST Interface

If the addFilesToInventory attribute (see Option for Creating New File Associations in Target Inventory) or the markFilesAsReviewed attribute (see Option for Marking Target Codebase Files as Reviewed) is set to true, you must include an additional attribute that defines the file-matching criteria needed to compare files in the import data file with the target codebase files:

For addFilesToInventory, include the inventoryFileMatchingCritieria attribute.
For markFilesAsReviewed, include the reviewFileMatchingCritieria attribute.

Note:This ...FileMatchingCriteria attribute is required whenever addFilesToInventory or markFilesAsReviewed is set to true. If this attribute is omitted, an error occurs when you attempt to execute the import command.

If you are using the Import Project Data REST API to execute the import process, refer the information in this section for details about the criteria.

If you are performing the import through the Code Insight Web UI, refer to the Import Project Data Dialog for criteria descriptions.

Available File-Matching Criteria in the Import REST Interface

The following describes the available criteria for the inventoryFileMatchingCritieria attribute or reviewFileMatchingCritieria attribute used to locate file matches between the import data file and the target project codebase.

Possible Values for File-Matching Criteria

Attribute Value

Description

MD5_AND_COMPLETE_
FILEPATH

A file’s MD5 value and complete path (including the file name) in the import data file must match the MD5 and complete path of a file in the target project codebase.

MD5_AND_PARTIAL_FILEPATH

A file’s MD5 value and partial path (including the file name) in the import data file must match the MD5 and partial path of a file in the target project codebase.

For this criterion, you must include an additional attribute to define the depth of the partial path. See Specifying Directory Depth for Partial-Path Criteria in the REST Interface for more information.

MD5_AND_FILENAME

The MD5 and name of a file in the import data file must match the MD5 and name of a file in the target project codebase.

MD5

A file’s MD5 value in the import data file must match an MD5 in the target project codebase.

COMPLETE_FILEPATH

The complete path of a file (including the file name) in the import data file must match a complete file path in the target project codebase.

PARTIAL_PATH

A file’s partial path (including of the file name) in the import data file must match the partial path of a file in the target project codebase.

For this criterion, you must include an additional attribute to define the depth of the partial path. See Specifying Directory Depth for Partial-Path Criteria in the REST Interface for more information.

FILENAME

The name of the file in the import data file must match a file name in the target project codebase. (No path is compared in the file-matching process.)

Specifying Directory Depth for Partial-Path Criteria in the REST Interface

If you specify MD5_AND_PARTIAL_PATH or PARTIAL_PATH as the value for the inventoryMatchingCriteria or the reviewFileMatchingCriteria attribute, you must include another attribute that defines the directory depth by which to match the partial paths:

For the inventoryMatchingCriteria, include the inventoryDirectoryDepth attribute.
For reviewFileMatchingCriteria, include the reviewDirectoryDepth attribute.

Note:This ...DirectoryDepth attribute is required whenever a partial-path criterion is specified for file matching. If this attribute is omitted, an error occurs when you attempt to execute the import command.

Provide a value 1 through 20 to designate the number of directories above the file name that must be the same when matching file paths in the import data file with file paths in the target project codebase.

For example, suppose a file has a complete path /ePortal-1.3/copy1/src/gettext.c. If a partial path criterion is set with a directory depth of 2 (that is, 2 directories above the file name), the partial path copy1/src/gettext.c in the import data file must match the same path in the target project codebase to meet the criterion.

The partial-path depth enables the import to match files when the codebase location is different between the target project codebase and the project codebase whose scanned results are included in the import data file. See also Complete vs Partial Paths in the Import Path-Matching Process.