refactor(config): refactored extraction of individualFileMatching property
package com.synopsys.integration.detect.configuration
import com.synopsys.integration.blackduck.api.generated.enumeration.PolicyRuleSeverityType
-import com.synopsys.integration.blackduck.codelocation.signaturescanner.command.IndividualFileMatching
import com.synopsys.integration.blackduck.codelocation.signaturescanner.command.SnippetMatching
import com.synopsys.integration.blackduck.configuration.BlackDuckServerConfigBuilder
import com.synopsys.integration.configuration.config.PropertyConfiguration
@@ -116,17 +115,6 @@ open class DetectConfigurationFactory(private val detectConfiguration: PropertyC
return null
}
- @Nullable
- fun findIndividualFileMatching(): IndividualFileMatching? {
- val individualFileMatching = detectConfiguration.getValue(DetectProperties.DETECT_BLACKDUCK_SIGNATURE_SCANNER_INDIVIDUAL_FILE_MATCHING)
-
- if (individualFileMatching.baseValue.isPresent) {
- return individualFileMatching.baseValue.get()
- }
-
- return null
- }
-
//#endregion
//#region Creating Connections
@@ -328,6 +316,7 @@ open class DetectConfigurationFactory(private val detectConfiguration: PropertyC
val dryRun = PropertyConfigUtils.getFirstProvidedValueOrDefault(detectConfiguration, DetectProperties.DETECT_BLACKDUCK_SIGNATURE_SCANNER_DRY_RUN, DetectProperties.DETECT_HUB_SIGNATURE_SCANNER_DRY_RUN)
val uploadSource = detectConfiguration.getValue(DetectProperties.DETECT_BLACKDUCK_SIGNATURE_SCANNER_UPLOAD_SOURCE_MODE)
val licenseSearch = detectConfiguration.getValue(DetectProperties.DETECT_BLACKDUCK_SIGNATURE_SCANNER_LICENSE_SEARCH);
+ val individualFileMatching = detectConfiguration.getValue(DetectProperties.DETECT_BLACKDUCK_SIGNATURE_SCANNER_INDIVIDUAL_FILE_MATCHING).baseValue.orElse(null)
val codeLocationPrefix = detectConfiguration.getValue(DetectProperties.DETECT_PROJECT_CODELOCATION_PREFIX).orElse(null)
val codeLocationSuffix = detectConfiguration.getValue(DetectProperties.DETECT_PROJECT_CODELOCATION_SUFFIX).orElse(null)
val additionalArguments = PropertyConfigUtils.getFirstProvidedValueOrEmpty(detectConfiguration, DetectProperties.DETECT_BLACKDUCK_SIGNATURE_SCANNER_ARGUMENTS, DetectProperties.DETECT_HUB_SIGNATURE_SCANNER_ARGUMENTS).orElse(null)
@@ -361,7 +350,7 @@ open class DetectConfigurationFactory(private val detectConfiguration: PropertyC
codeLocationSuffix,
additionalArguments,
maxDepth,
- findIndividualFileMatching(),
+ individualFileMatching,
licenseSearch
)
}
