|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.netflix.config.WebApplicationProperties
public class WebApplicationProperties
This class helps in loading properties present in a typical web appplication.
1. In a series of application properties file (typically under
WEB-INF/conf/*)
2. Every library (JAR) located in the web application's
classpath i.e. WEB-INF/lib/*.jar, can contain properties in say
META-INF/conf/config.properties
This class helps load all the properties into the Default Configuration.
In case you would like to load these properties into another Configuration
instead, you can use getProperties()
to obtain the properties and
load these into the Configuration
of your choice.
Constructor Summary | |
---|---|
WebApplicationProperties()
|
Method Summary | |
---|---|
static java.io.File |
getAppConfFolder()
|
static java.lang.String |
getLibraryPropertiesResourceRelativePath()
Returns the relative Resource Path of the properties files in the JAR files |
static java.util.Properties |
getProperties()
Returns all the properties presently available |
protected static void |
initApplicationProperties()
|
protected static void |
initClasspathPropertiesConfiguration()
|
static void |
initialize()
Initialize. |
static void |
initialize(java.io.File appConfFolderFromConfig,
java.lang.String baseConfigFileName,
boolean loadLibraryProperties,
java.lang.String propertiesResourceRelativePath)
Initialize. |
static void |
setAppConfFolder(java.io.File appConfFolderFromConfig,
java.lang.String baseConfigFileName)
The folder where the application's properties files are located. |
static void |
setLibraryPropertiesResourceRelativePath(java.lang.String libraryPropertiesResourceRelativePath)
Please see ClasspathPropertiesConfiguration on Library Properties. |
static void |
setLoadLibraryProperties(boolean loadLibraryProperties)
Set this if you would like the ClasspathPropertiesConfiguration
to scan the JAR files in the classpath and load those proerties into the
default Configuration |
static boolean |
shouldLoadLibraryProperties()
Should we load the Library Properties |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WebApplicationProperties()
Method Detail |
---|
public static void initialize(java.io.File appConfFolderFromConfig, java.lang.String baseConfigFileName, boolean loadLibraryProperties, java.lang.String propertiesResourceRelativePath)
setAppConfFolder(File, String)
method.
appConfFolderFromConfig
- baseConfigFileName
- loadLibraryProperties
- propertiesResourceRelativePath
- public static void initialize()
setAppConfFolder(File, String)
method.
protected static void initClasspathPropertiesConfiguration()
protected static void initApplicationProperties() throws org.apache.commons.configuration.ConfigurationException, java.net.MalformedURLException
org.apache.commons.configuration.ConfigurationException
java.net.MalformedURLException
public static java.io.File getAppConfFolder()
public static void setAppConfFolder(java.io.File appConfFolderFromConfig, java.lang.String baseConfigFileName)
appConfFolderFromConfig
- the folder as a File
object where the
application's properties files are locatedbaseConfigFileName
- the "base" name of the properties file. For e.g. if you have
config.properties, config-test.properties, then the value to
pass in is "config"public static boolean shouldLoadLibraryProperties()
public static void setLoadLibraryProperties(boolean loadLibraryProperties)
ClasspathPropertiesConfiguration
to scan the JAR files in the classpath and load those proerties into the
default Configuration
loadLibraryProperties
- public static java.lang.String getLibraryPropertiesResourceRelativePath()
public static void setLibraryPropertiesResourceRelativePath(java.lang.String libraryPropertiesResourceRelativePath)
ClasspathPropertiesConfiguration
on Library Properties.
This methods sets the relativeResource path
libraryPropertiesResourceRelativePath
- public static java.util.Properties getProperties()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |