use of com.mercedesbenz.sechub.commons.model.SecHubDataConfigurationUsageByName in project sechub by mercedes-benz.
the class SecHubFileStructureDataProviderBuilder method addAllUsages.
private void addAllUsages(MutableSecHubFileStructureDataProvider data, Optional<? extends SecHubDataConfigurationUsageByName> scanDefinitionObject, boolean mustHave) {
if (!scanDefinitionObject.isPresent()) {
if (mustHave) {
new IllegalStateException("For scanType:" + scanType + " the configuration entry is missing.");
}
return;
}
SecHubDataConfigurationUsageByName usageByName = scanDefinitionObject.get();
Set<String> names = usageByName.getNamesOfUsedDataConfigurationObjects();
if (names.isEmpty()) {
if (mustHave) {
new SecHubRuntimeException("Confgiguration file problem. For scanType:" + scanType + " at least one data configuration must be referenced");
}
}
data.addAcceptedReferenceNames(names);
}
Aggregations