|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.paris.lutece.util.PropertiesService
public class PropertiesService
This class provides utility methods to read values of the properties stored in the .properties file of the application.
Constructor Summary | |
---|---|
PropertiesService(java.lang.String strRootPath)
Constructor should define the base root path for properties files |
Method Summary | |
---|---|
void |
addPropertiesDirectory(java.lang.String strRelativePath)
Add properties from all files found in a given directory |
void |
addPropertiesFile(java.lang.String strRelativePath,
java.lang.String strFilename)
Add properties from a properties file |
java.util.Properties |
getProperties()
Gets properties |
java.lang.String |
getProperty(java.lang.String strProperty)
Returns the value of a variable defined in the .properties file of the application as a String |
java.lang.String |
getProperty(java.lang.String strProperty,
java.lang.String strDefault)
Returns the value of a variable defined in the .properties file of the application as a String |
boolean |
getPropertyBoolean(java.lang.String strProperty,
boolean bDefault)
Returns the value of a variable defined in the .properties file of the application as an boolean |
int |
getPropertyInt(java.lang.String strProperty,
int nDefault)
Returns the value of a variable defined in the .properties file of the application as an int |
long |
getPropertyLong(java.lang.String strProperty,
long lDefault)
Returns the value of a variable defined in the .properties file of the application as an long |
void |
reload(java.lang.String strFilename)
Reload a properties file . |
void |
reloadAll()
Reload all properties files |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertiesService(java.lang.String strRootPath)
strRootPath
- The root pathMethod Detail |
---|
public void addPropertiesFile(java.lang.String strRelativePath, java.lang.String strFilename) throws java.io.FileNotFoundException, java.io.IOException
strRelativePath
- Relative path from the root pathstrFilename
- The filename of the properties file (ie: config.properties)
java.io.FileNotFoundException
- If the file is not found
java.io.IOException
- If an error occurs reading the filepublic void addPropertiesDirectory(java.lang.String strRelativePath) throws java.io.IOException
strRelativePath
- Relative path from the root path
java.io.IOException
- If an error occurs reading the filepublic void reload(java.lang.String strFilename) throws java.io.IOException
strFilename
- The filename of the properties file
java.io.IOException
- If an error occurs reading the filepublic void reloadAll() throws java.io.IOException
java.io.IOException
- If an error occurs reading the filepublic java.lang.String getProperty(java.lang.String strProperty)
strProperty
- The variable name
public java.lang.String getProperty(java.lang.String strProperty, java.lang.String strDefault)
strProperty
- The variable namestrDefault
- The default value which is returned if no value is found for the variable in the .properties
file.
public int getPropertyInt(java.lang.String strProperty, int nDefault)
strProperty
- The variable namenDefault
- The default value which is returned if no value is found for the variable in the le downloadFile
.properties. .properties file.
public long getPropertyLong(java.lang.String strProperty, long lDefault)
strProperty
- The variable namelDefault
- The default value which is returned if no value is found for the variable in the le downloadFile
.properties. .properties file.
public boolean getPropertyBoolean(java.lang.String strProperty, boolean bDefault)
strProperty
- The variable namebDefault
- The default value which is returned if no value is found for the variable in the le downloadFile
.properties. .properties file.
public java.util.Properties getProperties()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |