mirror of
https://github.com/datahub-project/datahub.git
synced 2025-07-06 08:38:41 +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);
|
||
|
}
|
||
|
|
||
|
}
|