Package de.hybris.platform.util
Class Config
java.lang.Object
de.hybris.platform.util.Config
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:
- 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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic interfacestatic enumstatic interfaceOffers fields which defines the names of the supported databases.static interfaceDefines all parameters configurable using project.properties.static interface -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a copy of all parameters as a key/value pair map.static booleangetBoolean(String key, boolean def) static charstatic StringReturns the database name.static Config.DatabaseNamestatic Stringstatic Stringstatic doublestatic intstatic longstatic StringgetParameter(String key) Returns a parameter value for a given key.getParametersByPattern(String pattern) Return a copy of all config parameters which starts with the given pattern.static Stringstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic voidsetParameter(String key, String value) Changes a parameter.static String
-
Constructor Details
-
Config
public Config()
-
-
Method Details
-
getParametersByPattern
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
Returns a copy of all parameters as a key/value pair map.- Returns:
- a new Map with all key/value pairs
-
getParameter
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
- Parameters:
key- the keydef- the default value- Returns:
- the value mapped to the key or the specified default value, if this key was not mapped.
-
getChar
- Throws:
IndexOutOfBoundsException
-
getBoolean
-
getInt
- Throws:
NumberFormatException
-
getLong
- Throws:
NumberFormatException
-
getDouble
- Throws:
NumberFormatException
-
setParameter
Changes a parameter.- Parameters:
key- the keyvalue- the value
-
getDatabase
Returns the database name.- Returns:
- the database name as interned String constant
-
getDatabaseVersion
-
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
-
isCloudEnvironment
public static boolean isCloudEnvironment() -
trim
-