Package fr.paris.lutece.util
Class PropertiesService
java.lang.Object
fr.paris.lutece.util.PropertiesService
This class provides utility methods to read values of the properties stored in the .properties file of the application.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor should define the base root path for properties files -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPropertiesFile(String strRelativePath, String strFilename) Add properties from a properties filevoidaddPropertiesPaths(Set<String> setPaths) Add properties from a given set of resource paths.Gets propertiesgetProperty(String strProperty) Returns the value of a variable defined in the .properties file of the application as a StringgetProperty(String strProperty, String strDefault) Returns the value of a variable defined in the .properties file of the application as a String
-
Constructor Details
-
PropertiesService
public PropertiesService()Constructor should define the base root path for properties files- Parameters:
strRootPath- The root path
-
-
Method Details
-
addPropertiesFile
Add properties from a properties file- Parameters:
strRelativePath- Relative path from the root pathstrFilename- The filename of the properties file (ie: config.properties)
-
addPropertiesPaths
Add properties from a given set of resource paths.- Parameters:
setPaths- The set of resource paths to load
-
getProperty
Returns the value of a variable defined in the .properties file of the application as a String- Parameters:
strProperty- The variable name- Returns:
- The variable value read in the properties file
-
getProperty
Returns the value of a variable defined in the .properties file of the application as a String- Parameters:
strProperty- The variable namestrDefault- The default value which is returned if no value is found for the variable in the .properties file.- Returns:
- The variable value read in the properties file
-
getProperties
Gets properties- Returns:
- All properties
-