public class PropertyManager
extends java.lang.Object
setRoot(String) are called before server's configurations was read.| Modifier and Type | Method and Description |
|---|---|
static void |
flush()
Flushes the cache, causing the files to be loaded again, when they are needed.
|
static java.util.Properties |
getPropertiesFrom(java.lang.String path)
Get
Properties by specified path. |
static java.lang.String |
getPropertyFrom(java.lang.String path,
java.lang.String property)
Gets the value of asked property.
|
static java.io.File |
getRoot() |
static java.util.Properties |
getServerProperties()
Get
Properties from a config file. |
static java.lang.String |
getServerProperty(java.lang.String property)
Gets the value of property from server properties file or returns empty
string if there is no such property
|
static java.lang.String |
getServerProperty(java.lang.String property,
java.lang.String defaultValue)
Gets the value of property from server properties file or returns
default value if there is no such server property.
|
static void |
setRoot(java.io.File newRoot)
This method must be called before any other methods of this manager
|
static void |
setRoot(java.lang.String newRoot)
This method must be called before any other methods of this manager
|
public static java.io.File getRoot()
@NotNull public static void setRoot(java.lang.String newRoot)
newRoot - the root path of web application@NotNull public static void setRoot(java.io.File newRoot)
newRoot - the root path of web applicationpublic static java.lang.String getPropertyFrom(java.lang.String path,
java.lang.String property)
path - Path to properties file.property - The property which needs to be read.String type of asked propertypublic static java.util.Properties getPropertiesFrom(java.lang.String path)
Properties by specified path.path - Path to properties file.public static java.lang.String getServerProperty(java.lang.String property)
property - The property which needs to be read from server properties fileString value of asked property or empty stringpublic static java.lang.String getServerProperty(java.lang.String property,
java.lang.String defaultValue)
property - The property which needs to be read from server properties filedefaultValue - default value that will be returned if there is no such server propertyString value of asked property or default valuepublic static java.util.Properties getServerProperties()
Properties from a config file.public static void flush()