Class AppSettings

java.lang.Object
com.axelor.app.AppSettings

public final class AppSettings extends Object
  • Method Details

    • get

      public static AppSettings get()
    • get

      public String get(String key)
    • get

      public String get(String key, String defaultValue)
    • getList

      public List<String> getList(String key)
    • getList

      public <T> List<T> getList(String key, Function<String,T> mapper)
    • getInt

      public int getInt(String key, int defaultValue)
    • getLong

      public long getLong(String key, long defaultValue)
    • getBoolean

      public boolean getBoolean(String key, boolean defaultValue)
    • getPath

      public String getPath(String key, String defaultValue)
    • format

      public String format(String value)
      Format the property value. Variables in the format ${} format will be substituted.
      Parameters:
      value - the property value
      Returns:
      the formatted property value
    • getBaseURL

      public String getBaseURL()
      Retrieves the base URL for the application.

      The base URL is determined through the following order:
      1. If a tenant identifier is resolved and its corresponding host is available, that host is used.
      2. If no tenant-specific host is found, the application base URL from the application.base-url configuration setting is used.
      3. If neither are available, the base URL is retrieved from the current http request.

      Returns:
      the resolved base URL for the application
    • getTenantBaseUrl

      @Nullable protected String getTenantBaseUrl(String tenantId)
    • isProduction

      public boolean isProduction()
    • getInternalProperties

      public Map<String,String> getInternalProperties()
      For internal use only.
      Returns:
      the internal properties store
    • getProperties

      public Map<String,String> getProperties()
      For internal use only.
      Returns:
      the internal properties store
    • getPropertiesKeys

      public Set<String> getPropertiesKeys()
      Get all properties keys
      Returns:
      an unmodifiable Set of keys
    • getPropertiesKeysStartingWith

      public Set<String> getPropertiesKeysStartingWith(String prefix)
      Get properties keys starting with the given prefix
      Returns:
      an unmodifiable Set of keys
    • getPropertiesStartingWith

      public Map<String,String> getPropertiesStartingWith(String prefix)
      Get properties where the key start with the given prefix
      Returns:
      an unmodifiable Map of matching properties
    • enableFeature

      public void enableFeature(String name)
      Enable specified feature
      Parameters:
      name - name of the feature
    • disableFeature

      public void disableFeature(String name)
      Disable specified feature
      Parameters:
      name - name of the feature
    • hasFeature

      public boolean hasFeature(String name)
      Check whether specified feature is enabled
      Parameters:
      name - name of the feature
      Returns:
      true if feature is enabled false otherwise