Search in sources :

Example 1 with Environment

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;
}
Also used : Environment(org.keycloak.quarkus.runtime.Environment) File(java.io.File)

Aggregations

File (java.io.File)1 Environment (org.keycloak.quarkus.runtime.Environment)1