public class PropertiesLoader
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
INNER_PATH |
static java.lang.String |
PROPERTIES_PATH_PROPERTY |
static java.nio.charset.Charset |
STANDARD_CHARSET |
| Modifier and Type | Method and Description |
|---|---|
java.util.Properties |
getProperties()
Get all properties loaded from properties file and reloaded from from
environment variables.
|
java.lang.String |
getProperty(ListenerProperty propertyName)
Get specified property
|
java.lang.String |
getProperty(ListenerProperty propertyName,
java.lang.String defaultValue)
Get specified property
|
java.lang.String |
getProperty(java.lang.String propertyName)
Get specified property loaded from properties file and reloaded from from
environment variables.
|
boolean |
getPropertyAsBoolean(ListenerProperty propertyName,
boolean defaultValue)
Get specified property
|
int |
getPropertyAsInt(ListenerProperty propertyName,
int defaultValue)
Get specified property
|
long |
getPropertyAsLong(ListenerProperty propertyName,
long defaultValue)
Get specified property
|
static java.lang.String |
getPropertyFilePath()
Get path to ReportPortal configuration file according to Environment Variables and System Properties.
|
static PropertiesLoader |
load()
Loads properties from default location
|
static PropertiesLoader |
load(java.lang.String resource)
Loads properties from specified location
|
void |
overrideWith(java.util.Properties overrides)
Overrides properties with provided values
|
public static final java.lang.String PROPERTIES_PATH_PROPERTY
public static final java.lang.String INNER_PATH
public static final java.nio.charset.Charset STANDARD_CHARSET
public static PropertiesLoader load(java.lang.String resource)
resource - Path to resources in classpathpublic static java.lang.String getPropertyFilePath()
public static PropertiesLoader load()
INNER_PATHpublic java.lang.String getProperty(java.lang.String propertyName)
propertyName - Name of propertypublic java.lang.String getProperty(ListenerProperty propertyName, java.lang.String defaultValue)
propertyName - Name of propertydefaultValue - Default valuepublic boolean getPropertyAsBoolean(ListenerProperty propertyName, boolean defaultValue)
propertyName - Name of propertydefaultValue - Default valuepublic int getPropertyAsInt(ListenerProperty propertyName, int defaultValue)
propertyName - Name of propertydefaultValue - Default valuedefaultValue otherwisepublic long getPropertyAsLong(ListenerProperty propertyName, long defaultValue)
propertyName - Name of propertydefaultValue - Default valuedefaultValue otherwisepublic java.lang.String getProperty(ListenerProperty propertyName)
propertyName - Name of propertypublic java.util.Properties getProperties()
public void overrideWith(java.util.Properties overrides)
overrides - Values to overrides