Package fr.paris.lutece.util
Class AppInitPropertiesService
java.lang.Object
fr.paris.lutece.util.AppInitPropertiesService
This class provides management services for properties files.
The configuration is split into two independent sources :
- a base source holding every
.propertiesfile except those located under theoverride/andoverride/pluginsdirectories ; - an override source holding only the
.propertiesfiles located under theoverride/andoverride/pluginsdirectories.
Each source is exposed to MicroProfile Config through a dedicated ConfigSource, the override
source being given a higher ordinal so that its values take precedence over the base ones.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the names of the variables defined in the base properties files (everything except the override directories).static StringgetBaseProperty(String strProperty) Returns the value of a variable defined in the base properties files (everything except the override directories) as a String.Returns a list of keys that match a given prefix.Returns the names of the variables defined in the override properties files (override/andoverride/plugins).static StringgetOverrideProperty(String strProperty) Returns the value of a variable defined in the override properties files (override/andoverride/plugins) as a String.static PropertiesGets all properties, merging the base and the override sources, the override values taking precedence.Get all properties As mapReturn the union of the base and the override property names.static StringgetProperty(String strProperty) Returns the value of a variable defined in the .properties files of the application as a String.static voidInitializes the base and the override properties services.
-
Method Details
-
init
Initializes the base and the override properties services.- Parameters:
strConfPath- The configuration path
-
getBaseProperty
Returns the value of a variable defined in the base properties files (everything except the override directories) as a String.- Parameters:
strProperty- The variable name- Returns:
- The variable value read in the base properties files
-
getBasePropertiesName
Returns the names of the variables defined in the base properties files (everything except the override directories).- Returns:
- The set of base property names
-
getOverrideProperty
Returns the value of a variable defined in the override properties files (override/andoverride/plugins) as a String.- Parameters:
strProperty- The variable name- Returns:
- The variable value read in the override properties files
-
getOverridePropertiesName
Returns the names of the variables defined in the override properties files (override/andoverride/plugins).- Returns:
- The set of override property names
-
getProperty
Returns the value of a variable defined in the .properties files of the application as a String. The override source takes precedence over the base source.- Parameters:
strProperty- The variable name- Returns:
- The variable value read in the properties files
-
getProperties
Gets all properties, merging the base and the override sources, the override values taking precedence.- Returns:
- All properties
- Since:
- version 3.0
-
getPropertiesAsMap
Get all properties As map- Returns:
- Properties as map
-
getPropertiesName
Return the union of the base and the override property names.- Returns:
- The set of all property names
-
getKeys
Returns a list of keys that match a given prefix.- Parameters:
strPrefix- the str prefix- Returns:
- A list of keys that match the prefix
- Since:
- version 7.0
-