use of org.keycloak.quarkus.runtime.Environment in project keycloak by keycloak.
the class QuarkusFolderThemeProviderFactory method getThemeRootDirWithFallback.
/**
* Determines if the theme root directory we get
* from {@link Config} exists.
* If not, uses the default theme directory as a fallback.
*
* @param rootDirFromConfig string value from {@link Config}
* @return Directory to use as theme root directory in {@link File} format, either from config or from default. Null if none is available.
* @throws RuntimeException when filesystem path is not accessible
*/
private File getThemeRootDirWithFallback(String rootDirFromConfig) {
File themeRootDir;
themeRootDir = new File(Objects.requireNonNullElseGet(rootDirFromConfig, Environment::getDefaultThemeRootDir));
if (!themeRootDir.exists()) {
return null;
}
return themeRootDir;
}
Aggregations