Class Environment

java.lang.Object
org.keycloak.quarkus.runtime.Environment

public final class Environment extends Object
  • Field Details

  • Method Details

    • isRebuild

      public static Boolean isRebuild()
    • isRuntimeMode

      public static Boolean isRuntimeMode()
    • getHomeDir

      public static String getHomeDir()
    • getHomePath

      public static Path getHomePath()
    • getDataDir

      public static String getDataDir()
    • getDefaultThemeRootDir

      public static String getDefaultThemeRootDir()
    • getProvidersPath

      public static Path getProvidersPath()
    • getCommand

      public static String getCommand()
    • setProfile

      public static void setProfile(String profile)
    • getCurrentOrPersistedProfile

      public static String getCurrentOrPersistedProfile()
    • getProfileOrDefault

      public static String getProfileOrDefault(String defaultProfile)
    • isDevMode

      public static boolean isDevMode()
    • isDevProfile

      public static boolean isDevProfile()
    • isNonServerMode

      public static boolean isNonServerMode()
    • isWindows

      public static boolean isWindows()
    • forceDevProfile

      public static void forceDevProfile()
    • getProviderFiles

      public static Map<String,File> getProviderFiles()
    • isTestLaunchMode

      public static boolean isTestLaunchMode()
    • forceTestLaunchMode

      public static void forceTestLaunchMode()
    • getKeycloakModeFromProfile

      public static String getKeycloakModeFromProfile(String profile)
      We want to hide the "profiles" from Quarkus to not make things unnecessarily complicated for users, so this method returns the equivalent launch mode instead. For use in e.g. CLI Output.
      Parameters:
      profile - the internal profile string used
      Returns:
      the mapped launch mode, none when nothing is given or the profile as is when its neither null/empty nor matching the quarkus default profiles we use.
    • isDistribution

      public static boolean isDistribution()
    • isRebuildCheck

      public static boolean isRebuildCheck()
    • isRebuilt

      public static boolean isRebuilt()
    • setHomeDir

      public static void setHomeDir(Path path)
    • getCurrentOrCreateFeatureProfile

      public static Profile getCurrentOrCreateFeatureProfile()
      Do not call this method at runtime.

      The method is marked as synchronized because build steps are executed in parallel.
      Returns:
      the current feature profile instance
    • getParsedCommand

      public static Optional<AbstractCommand> getParsedCommand()
      Get parsed AbstractCommand we obtained from the CLI
    • isParsedCommand

      public static boolean isParsedCommand(String commandName)
    • setParsedCommand

      public static void setParsedCommand(AbstractCommand command)