Skip to content

Commit

Permalink
initial patch to add symbolic link depth per issue #285; more testing…
Browse files Browse the repository at this point in the history
… needs to be performed
  • Loading branch information
jeremylong committed Jul 22, 2015
1 parent 5b8d3de commit acbfb12
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -99,7 +99,8 @@ public void run(String[] args) {
} else if (cli.isRunScan()) {
populateSettings(cli);
try {
runScan(cli.getReportDirectory(), cli.getReportFormat(), cli.getApplicationName(), cli.getScanFiles(), cli.getExcludeList());
runScan(cli.getReportDirectory(), cli.getReportFormat(), cli.getApplicationName(), cli.getScanFiles(),
cli.getExcludeList(), cli.getSymLinkDepth());
} catch (InvalidScanPathException ex) {
LOGGER.error("An invalid scan path was detected; unable to scan '//*' paths");
}
Expand All @@ -116,11 +117,12 @@ public void run(String[] args) {
* @param applicationName the application name for the report
* @param files the files/directories to scan
* @param excludes the patterns for files/directories to exclude
* @param symLinkDepth the depth that symbolic links will be followed
*
* @throws InvalidScanPathException thrown if the path to scan starts with "//"
*/
private void runScan(String reportDirectory, String outputFormat, String applicationName, String[] files,
String[] excludes) throws InvalidScanPathException {
String[] excludes, int symLinkDepth) throws InvalidScanPathException {
Engine engine = null;
try {
engine = new Engine();
Expand Down Expand Up @@ -165,6 +167,7 @@ private void runScan(String reportDirectory, String outputFormat, String applica
}
scanner.setBasedir(baseDir);
scanner.setIncludes(include);
scanner.setMaxLevelsOfSymlinks(symLinkDepth);
if (excludes != null && excludes.length > 0) {
scanner.addExcludes(excludes);
}
Expand Down

0 comments on commit acbfb12

Please sign in to comment.