Search in sources :

Example 6 with SignatureScanPath

use of com.synopsys.integration.detect.tool.signaturescanner.SignatureScanPath in project synopsys-detect by blackducksoftware.

the class SignatureScanStepRunner method runSignatureScannerOffline.

public void runSignatureScannerOffline(NameVersion projectNameVersion, DockerTargetData dockerTargetData) throws DetectUserFriendlyException, OperationException {
    ScanBatchRunner scanBatchRunner = resolveOfflineScanBatchRunner();
    List<SignatureScanPath> scanPaths = operationFactory.createScanPaths(projectNameVersion, dockerTargetData);
    ScanBatch scanBatch = operationFactory.createScanBatchOffline(scanPaths, projectNameVersion, dockerTargetData);
    executeScan(scanBatch, scanBatchRunner, scanPaths);
}
Also used : ScanBatchRunner(com.synopsys.integration.blackduck.codelocation.signaturescanner.ScanBatchRunner) SignatureScanPath(com.synopsys.integration.detect.tool.signaturescanner.SignatureScanPath) ScanBatch(com.synopsys.integration.blackduck.codelocation.signaturescanner.ScanBatch)

Example 7 with SignatureScanPath

use of com.synopsys.integration.detect.tool.signaturescanner.SignatureScanPath in project synopsys-detect by blackducksoftware.

the class CreateSignatureScanReports method reportResults.

public List<SignatureScannerReport> reportResults(List<SignatureScanPath> signatureScanPaths, List<ScanCommandOutput> scanCommandOutputList) {
    List<SignatureScannerReport> signatureScannerReports = new ArrayList<>();
    for (SignatureScanPath signatureScanPath : signatureScanPaths) {
        Optional<ScanCommandOutput> scanCommandOutput = scanCommandOutputList.stream().filter(output -> output.getScanTarget().equals(signatureScanPath.getTargetCanonicalPath())).findFirst();
        SignatureScannerReport signatureScannerReport = SignatureScannerReport.create(signatureScanPath, scanCommandOutput.orElse(null));
        signatureScannerReports.add(signatureScannerReport);
    }
    return signatureScannerReports;
}
Also used : ScanCommandOutput(com.synopsys.integration.blackduck.codelocation.signaturescanner.command.ScanCommandOutput) SignatureScannerReport(com.synopsys.integration.detect.tool.signaturescanner.SignatureScannerReport) List(java.util.List) Logger(org.slf4j.Logger) SignatureScanPath(com.synopsys.integration.detect.tool.signaturescanner.SignatureScanPath) LoggerFactory(org.slf4j.LoggerFactory) Optional(java.util.Optional) ArrayList(java.util.ArrayList) SignatureScanPath(com.synopsys.integration.detect.tool.signaturescanner.SignatureScanPath) ArrayList(java.util.ArrayList) ScanCommandOutput(com.synopsys.integration.blackduck.codelocation.signaturescanner.command.ScanCommandOutput) SignatureScannerReport(com.synopsys.integration.detect.tool.signaturescanner.SignatureScannerReport)

Aggregations

SignatureScanPath (com.synopsys.integration.detect.tool.signaturescanner.SignatureScanPath)7 SignatureScannerReport (com.synopsys.integration.detect.tool.signaturescanner.SignatureScannerReport)3 ArrayList (java.util.ArrayList)3 ScanBatch (com.synopsys.integration.blackduck.codelocation.signaturescanner.ScanBatch)2 ScanBatchRunner (com.synopsys.integration.blackduck.codelocation.signaturescanner.ScanBatchRunner)2 ScanCommandOutput (com.synopsys.integration.blackduck.codelocation.signaturescanner.command.ScanCommandOutput)2 File (java.io.File)2 List (java.util.List)2 Optional (java.util.Optional)2 Logger (org.slf4j.Logger)2 LoggerFactory (org.slf4j.LoggerFactory)2 CodeLocationOutput (com.synopsys.integration.blackduck.codelocation.CodeLocationOutput)1 Result (com.synopsys.integration.blackduck.codelocation.Result)1 ScanBatchBuilder (com.synopsys.integration.blackduck.codelocation.signaturescanner.ScanBatchBuilder)1 NotificationTaskRange (com.synopsys.integration.blackduck.service.model.NotificationTaskRange)1 DetectUserFriendlyException (com.synopsys.integration.detect.configuration.DetectUserFriendlyException)1 SignatureScanStatusType (com.synopsys.integration.detect.tool.signaturescanner.enums.SignatureScanStatusType)1 ExclusionPatternCreator (com.synopsys.integration.detect.workflow.blackduck.ExclusionPatternCreator)1 Path (java.nio.file.Path)1 HashSet (java.util.HashSet)1