Search in sources :

Example 1 with ExclusionPatternCreator

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;
}
Also used : SignatureScanPath(com.synopsys.integration.detect.tool.signaturescanner.SignatureScanPath) File(java.io.File) ExclusionPatternCreator(com.synopsys.integration.detect.workflow.blackduck.ExclusionPatternCreator) HashSet(java.util.HashSet)

Aggregations

SignatureScanPath (com.synopsys.integration.detect.tool.signaturescanner.SignatureScanPath)1 ExclusionPatternCreator (com.synopsys.integration.detect.workflow.blackduck.ExclusionPatternCreator)1 File (java.io.File)1 HashSet (java.util.HashSet)1