Class Config

java.lang.Object
de.hybris.platform.util.Config

public abstract class Config extends Object
Main class that is used to load and store hybris platform configuration settings.

When starting up the hybris Platform the system tries to load the system resource '/project.properties' which is normally inside the platform/ directory or the local.properties which is normally at the config folder of the deployed ear file. This file is a file with entries of the form

         key1=value
         key2=value
         ...
 

Important:

  1. The configuration file is loaded only once at startup. If you change it manually it may get overridden when using methods to write the file. (Config.setParameter()) This issue may be addressed in a future release.
  • Constructor Details

    • Config

      public Config()
  • Method Details

    • getParametersByPattern

      public static Map<String,String> getParametersByPattern(String pattern)
      Return a copy of all config parameters which starts with the given pattern.
      Parameters:
      pattern - the pattern to match
      Returns:
      a new Map with the matching key/value pairs
    • getAllParameters

      public static Map<String,String> getAllParameters()
      Returns a copy of all parameters as a key/value pair map.
      Returns:
      a new Map with all key/value pairs
    • getParameter

      public static String getParameter(String key)
      Returns a parameter value for a given key.
      Parameters:
      key - the key
      Returns:
      the value mapped to the key or null, if this key was not mapped.
    • getString

      public static String getString(String key, String def)
      Parameters:
      key - the key
      def - the default value
      Returns:
      the value mapped to the key or the specified default value, if this key was not mapped.
    • getChar

      public static char getChar(String key, char def) throws IndexOutOfBoundsException
      Throws:
      IndexOutOfBoundsException
    • getBoolean

      public static boolean getBoolean(String key, boolean def)
    • getInt

      public static int getInt(String key, int def) throws NumberFormatException
      Throws:
      NumberFormatException
    • getLong

      public static long getLong(String key, long def) throws NumberFormatException
      Throws:
      NumberFormatException
    • getDouble

      public static double getDouble(String key, double def) throws NumberFormatException
      Throws:
      NumberFormatException
    • setParameter

      public static void setParameter(String key, String value)
      Changes a parameter.
      Parameters:
      key - the key
      value - the value
    • getDatabase

      public static String getDatabase()
      Returns the database name.
      Returns:
      the database name as interned String constant
    • getDatabaseVersion

      public static String getDatabaseVersion()
    • getDatabaseName

      public static Config.DatabaseName getDatabaseName()
    • isOracleUsed

      public static boolean isOracleUsed()
    • isHSQLDBUsed

      public static boolean isHSQLDBUsed()
    • isMySQLUsed

      public static boolean isMySQLUsed()
    • isMySQL8Used

      public static boolean isMySQL8Used()
    • isSQLServerUsed

      public static boolean isSQLServerUsed()
    • isHanaUsed

      public static boolean isHanaUsed()
    • isPostgreSQLUsed

      public static boolean isPostgreSQLUsed()
    • getDatabaseURL

      public static String getDatabaseURL()
    • isCloudEnvironment

      public static boolean isCloudEnvironment()
    • trim

      public static String trim(String value, char[] ignore)