Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
Signed-off-by: Iliyan Velichkov <velichkov.iliyan@gmail.com>
  • Loading branch information
iliyan-velichkov committed Jan 23, 2025
1 parent a11f52c commit 54dc97b
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,22 @@ private void saveDataSource(String name) {
}

private String getRequiredParameter(String dataSourceName, String suffix) {
String configName = dataSourceName + "_" + suffix;
String configName = createConfigName(dataSourceName, suffix);
String value = Configuration.get(configName);
if (null == value || value.trim()
.isEmpty()) {
throw new IllegalArgumentException(
"Missing required configuration parameter [" + configName + "] for data source [" + dataSourceName + "]. The value is: "
+ value);
throw new IllegalArgumentException("Missing required configuration parameter [" + configName + "] for data source ["
+ dataSourceName + "]. The value is: " + value);
}
return value;
}

private String createConfigName(String dataSourceName, String suffix) {
return dataSourceName + "_" + suffix;
}

private String getOptionalParameter(String dataSourceName, String suffix) {
String configName = dataSourceName + "_" + suffix;
String configName = createConfigName(dataSourceName, suffix);
String value = Configuration.get(configName);
if (null == value || value.trim()
.isEmpty()) {
Expand Down

0 comments on commit 54dc97b

Please sign in to comment.