mirror of
https://github.com/datahub-project/datahub.git
synced 2025-07-24 18:10:11 +00:00
28 lines
632 B
Java
28 lines
632 B
Java
package react.auth;
|
|
|
|
public class ConfigUtil {
|
|
|
|
private ConfigUtil() { }
|
|
|
|
public static String getRequired(
|
|
final com.typesafe.config.Config configs,
|
|
final String path) {
|
|
if (!configs.hasPath(path)) {
|
|
throw new IllegalArgumentException(
|
|
String.format("Missing required config with path %s", path));
|
|
}
|
|
return configs.getString(path);
|
|
}
|
|
|
|
public static String getOptional
|
|
(final com.typesafe.config.Config configs,
|
|
final String path,
|
|
final String defaultVal) {
|
|
if (!configs.hasPath(path)) {
|
|
return defaultVal;
|
|
}
|
|
return configs.getString(path);
|
|
}
|
|
|
|
}
|