|
||||||||||
| 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(String strRootPath)
Constructor should define the base root path for properties files |
|
| Method Summary | |
|---|---|
void |
addPropertiesDirectory(String strRelativePath)
Add properties from all files found in a given directory |
void |
addPropertiesFile(String strRelativePath,
String strFilename)
Add properties from a properties file |
Properties |
getProperties()
Gets properties |
String |
getProperty(String strProperty)
Returns the value of a variable defined in the .properties file of the application as a String |
String |
getProperty(String strProperty,
String strDefault)
Returns the value of a variable defined in the .properties file of the application as a String |
boolean |
getPropertyBoolean(String strProperty,
boolean bDefault)
Returns the value of a variable defined in the .properties file of the application as an boolean |
int |
getPropertyInt(String strProperty,
int nDefault)
Returns the value of a variable defined in the .properties file of the application as an int |
long |
getPropertyLong(String strProperty,
long lDefault)
Returns the value of a variable defined in the .properties file of the application as an long |
void |
reload(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(String strRootPath)
strRootPath - The root path| Method Detail |
|---|
public void addPropertiesFile(String strRelativePath,
String strFilename)
throws FileNotFoundException,
IOException
strRelativePath - Relative path from the root pathstrFilename - The filename of the properties file (ie: config.properties)
FileNotFoundException - If the file is not found
IOException - If an error occurs reading the file
public void addPropertiesDirectory(String strRelativePath)
throws IOException
strRelativePath - Relative path from the root path
IOException - If an error occurs reading the file
public void reload(String strFilename)
throws IOException
strFilename - The filename of the properties file
IOException - If an error occurs reading the file
public void reloadAll()
throws IOException
IOException - If an error occurs reading the filepublic String getProperty(String strProperty)
strProperty - The variable name
public String getProperty(String strProperty,
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(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(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(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 Properties getProperties()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||