Search in sources :

Example 1 with NotificationTaskRange

use of com.synopsys.integration.blackduck.service.model.NotificationTaskRange in project hub-detect by blackducksoftware.

the class BlackDuckBinaryScannerTool method performBinaryScanActions.

public BinaryScanToolResult performBinaryScanActions(final NameVersion projectNameVersion) throws DetectUserFriendlyException {
    if (StringUtils.isNotBlank(detectConfiguration.getProperty(DetectProperty.DETECT_BINARY_SCAN_FILE, PropertyAuthority.None))) {
        final String prefix = detectConfiguration.getProperty(DetectProperty.DETECT_PROJECT_CODELOCATION_PREFIX, PropertyAuthority.None);
        final String suffix = detectConfiguration.getProperty(DetectProperty.DETECT_PROJECT_CODELOCATION_SUFFIX, PropertyAuthority.None);
        final File file = new File(detectConfiguration.getProperty(DetectProperty.DETECT_BINARY_SCAN_FILE, PropertyAuthority.None));
        NotificationTaskRange taskRange = calculateTaskRange();
        Set<String> codeLocationNames = uploadBinaryScanFile(blackDuckServicesFactory.createBinaryScannerService(), file, projectNameVersion.getName(), projectNameVersion.getVersion(), prefix, suffix);
        return new BinaryScanToolResult(taskRange, codeLocationNames, true);
    } else {
        logger.debug("No binary scan path was provided, so binary scan will not occur.");
        return new BinaryScanToolResult(null, null, false);
    }
}
Also used : NotificationTaskRange(com.synopsys.integration.blackduck.service.model.NotificationTaskRange) File(java.io.File)

Example 2 with NotificationTaskRange

use of com.synopsys.integration.blackduck.service.model.NotificationTaskRange in project hub-detect by blackducksoftware.

the class OnlineBlackDuckSignatureScanner method performOnlineScan.

public CodeLocationCreationData<ScanBatchOutput> performOnlineScan(NameVersion projectNameVersion, File installDirectory, File dockerTarFile) throws InterruptedException, IntegrationException, DetectUserFriendlyException, IOException {
    NotificationTaskRange notificationTaskRange = codeLocationCreationService.calculateCodeLocationRange();
    ScanBatchOutput scanBatchOutput = performScanActions(projectNameVersion, installDirectory, dockerTarFile);
    CodeLocationCreationData<ScanBatchOutput> creationData = new CodeLocationCreationData<>(notificationTaskRange, scanBatchOutput);
    return creationData;
}
Also used : CodeLocationCreationData(com.synopsys.integration.blackduck.codelocation.CodeLocationCreationData) NotificationTaskRange(com.synopsys.integration.blackduck.service.model.NotificationTaskRange) ScanBatchOutput(com.synopsys.integration.blackduck.codelocation.signaturescanner.ScanBatchOutput)

Aggregations

NotificationTaskRange (com.synopsys.integration.blackduck.service.model.NotificationTaskRange)2 CodeLocationCreationData (com.synopsys.integration.blackduck.codelocation.CodeLocationCreationData)1 ScanBatchOutput (com.synopsys.integration.blackduck.codelocation.signaturescanner.ScanBatchOutput)1 File (java.io.File)1