use of com.synopsys.integration.detect.workflow.blackduck.ExclusionPatternCreator in project synopsys-detect by blackducksoftware.
the class CalculateScanPathsOperation method createScanPath.
private SignatureScanPath createScanPath(Path path, Integer maxDepth, List<String> exclusionPatterns, boolean followSymLinks) {
File target = path.toFile();
ExclusionPatternCreator exclusionPatternCreator = new ExclusionPatternCreator(fileFinder, fileFilter, target);
Set<String> scanExclusionPatterns = new HashSet<>();
// First add explicit exclusions that are correctly formatted
scanExclusionPatterns.addAll(exclusionPatterns.stream().filter(this::isCorrectlyFormattedExclusion).collect(Collectors.toSet()));
scanExclusionPatterns.addAll(exclusionPatternCreator.determineExclusionPatterns(followSymLinks, maxDepth, exclusionPatterns));
SignatureScanPath signatureScanPath = new SignatureScanPath();
signatureScanPath.setTargetPath(target);
signatureScanPath.getExclusions().addAll(scanExclusionPatterns);
return signatureScanPath;
}
Aggregations