mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-20 16:24:11 +01:00
initial patch to add symbolic link depth per issue #285; more testing needs to be performed
Former-commit-id: bc40f8cfc1410c46e402ce6931e53f377b5c60ee
This commit is contained in:
@@ -99,7 +99,8 @@ public class App {
|
|||||||
} else if (cli.isRunScan()) {
|
} else if (cli.isRunScan()) {
|
||||||
populateSettings(cli);
|
populateSettings(cli);
|
||||||
try {
|
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) {
|
} catch (InvalidScanPathException ex) {
|
||||||
LOGGER.error("An invalid scan path was detected; unable to scan '//*' paths");
|
LOGGER.error("An invalid scan path was detected; unable to scan '//*' paths");
|
||||||
}
|
}
|
||||||
@@ -116,11 +117,12 @@ public class App {
|
|||||||
* @param applicationName the application name for the report
|
* @param applicationName the application name for the report
|
||||||
* @param files the files/directories to scan
|
* @param files the files/directories to scan
|
||||||
* @param excludes the patterns for files/directories to exclude
|
* @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 "//"
|
* @throws InvalidScanPathException thrown if the path to scan starts with "//"
|
||||||
*/
|
*/
|
||||||
private void runScan(String reportDirectory, String outputFormat, String applicationName, String[] files,
|
private void runScan(String reportDirectory, String outputFormat, String applicationName, String[] files,
|
||||||
String[] excludes) throws InvalidScanPathException {
|
String[] excludes, int symLinkDepth) throws InvalidScanPathException {
|
||||||
Engine engine = null;
|
Engine engine = null;
|
||||||
try {
|
try {
|
||||||
engine = new Engine();
|
engine = new Engine();
|
||||||
@@ -165,6 +167,7 @@ public class App {
|
|||||||
}
|
}
|
||||||
scanner.setBasedir(baseDir);
|
scanner.setBasedir(baseDir);
|
||||||
scanner.setIncludes(include);
|
scanner.setIncludes(include);
|
||||||
|
scanner.setMaxLevelsOfSymlinks(symLinkDepth);
|
||||||
if (excludes != null && excludes.length > 0) {
|
if (excludes != null && excludes.length > 0) {
|
||||||
scanner.addExcludes(excludes);
|
scanner.addExcludes(excludes);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user