Package be.gaudry.model.config
Class PropertiesHelper
java.lang.Object
be.gaudry.model.config.PropertiesHelper
Helps to use the
Properties
.
Provided by the broldev.core.model project.- Since:
- 1.0 Jun 30, 2008, broldev.core.model 0.0.1-SNAPSHOT dependency
- Version:
- 1.0 Jun 30, 2008
- Author:
- Steph GAUDRY
- See Also:
RememberHelper(to use also specific operating system user properties)
-
Field Summary
-
Constructor Summary
ConstructorDescriptionBuilds aPropertiesHelper
with a default path.PropertiesHelper(String propertiesFilePath)
Builds aPropertiesHelper
with a dot separated path. -
Method Summary
Modifier and TypeMethodDescriptionvoid
debugProperties(Properties props)
Outputs each key/value pair on the logger with a debug level See thelogging information
to know how the logging is implemented.Comments to put on the top of the property file.Reads a property file at the selected location.boolean
saveProperties(Properties props)
Saves the property file in the selected path See thelogging information
to know how the logging is implemented.void
setComments(String comments)
-
Field Details
-
EXC_RESOURCE_PATH
Key for theException
localized messages.- See Also:
- Constant Field Values
-
-
Constructor Details
-
PropertiesHelper
Builds aPropertiesHelper
with a dot separated path.- Parameters:
propertiesFilePath
-
-
PropertiesHelper
public PropertiesHelper()Builds aPropertiesHelper
with a default path.
-
-
Method Details
-
getComments
Comments to put on the top of the property file.- Returns:
- the comments
-
setComments
- Parameters:
comments
- the comments to set- See Also:
getComments()
-
saveProperties
Saves the property file in the selected path See thelogging information
to know how the logging is implemented.- Parameters:
props
- properties to save- Returns:
- true if the properties have been saved.
-
loadProperties
Reads a property file at the selected location. In case ofFileNotFoundException
orIOException
, returns an emptyProperties
. See thelogging information
to know how the logging is implemented.- Returns:
- loaded Properties
-
debugProperties
Outputs each key/value pair on the logger with a debug level See thelogging information
to know how the logging is implemented.- Parameters:
props
- properties to debug
-