public class Configuration
extends java.util.Properties
Title: Configuration management
Description:
Copyright: Copyright (c) 2006-2014
Company:
Modifier and Type | Field and Description |
---|---|
private static Configuration |
config
Instance of this class - Singleton
|
private static java.lang.String |
FILENAME_PROPERTIES
Property file name
|
private static org.apache.log4j.Logger |
LOGGER
Logger
|
private static java.lang.String |
PROP_SYSTEM_USERHOMEDIR
System property containing the user's home directory
|
private static java.lang.String |
PROPERTIES_DIRECTORY
Sub-directory for the configuration files
|
private static long |
serialVersionUID
Serial UID
|
private static java.lang.String |
userHomeDirectory
The user's home directory
|
Modifier | Constructor and Description |
---|---|
private |
Configuration()
Setup the configuration instance
|
Modifier and Type | Method and Description |
---|---|
private static void |
copyFile(java.io.File source,
java.io.File dest)
Copy the content of a text file into another text file
|
java.io.File |
getFile(java.lang.String fileName)
Setup a file based on the file name
|
private java.lang.String |
getFilePath(java.lang.String fileName)
Prepend the user's home directory path the the file name and create a file
instance
|
static Configuration |
instance()
Get the instance of this class
|
private void |
setupProperties()
Load the properties from the properties file
|
void |
store()
Store the configuration into the configuration file
|
private void |
userDefaultFile(java.lang.String fileName)
Prepend the user's home directory path the the file name and create a file
instance.
|
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
private static final long serialVersionUID
private static Configuration config
private static final org.apache.log4j.Logger LOGGER
private static final java.lang.String PROPERTIES_DIRECTORY
private static final java.lang.String FILENAME_PROPERTIES
private static final java.lang.String PROP_SYSTEM_USERHOMEDIR
private static java.lang.String userHomeDirectory
public static Configuration instance()
public void store()
private void setupProperties()
public java.io.File getFile(java.lang.String fileName)
fileName
- The file to create a file reference forgetFilePath(String)
,
userDefaultFile(String)
private java.lang.String getFilePath(java.lang.String fileName)
fileName
- The file nameprivate void userDefaultFile(java.lang.String fileName)
fileName
- The file nameprivate static void copyFile(java.io.File source, java.io.File dest)
source
- The source filedest
- The target file