Class PropertiesLoader
- java.lang.Object
-
- com.epam.reportportal.utils.properties.PropertiesLoader
-
public class PropertiesLoader extends java.lang.ObjectLoad ReportPortal launch start properties
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringINNER_PATHstatic java.lang.StringPROPERTIES_PATH_PROPERTYstatic java.nio.charset.CharsetSTANDARD_CHARSET
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.PropertiesgetProperties()Get all properties loaded from properties file and reloaded from from environment variables.java.lang.StringgetProperty(ListenerProperty propertyName)Get specified propertyjava.lang.StringgetProperty(ListenerProperty propertyName, java.lang.String defaultValue)Get specified propertyjava.lang.StringgetProperty(java.lang.String propertyName)Get specified property loaded from properties file and reloaded from from environment variables.booleangetPropertyAsBoolean(ListenerProperty propertyName, boolean defaultValue)Get specified propertyintgetPropertyAsInt(ListenerProperty propertyName, int defaultValue)Get specified propertylonggetPropertyAsLong(ListenerProperty propertyName, long defaultValue)Get specified propertystatic java.lang.StringgetPropertyFilePath()Get path to ReportPortal configuration file according to Environment Variables and System Properties.static PropertiesLoaderload()Loads properties from default locationstatic PropertiesLoaderload(java.lang.String resource)Loads properties from specified locationvoidoverrideWith(java.util.Properties overrides)Overrides properties with provided values
-
-
-
Field Detail
-
PROPERTIES_PATH_PROPERTY
public static final java.lang.String PROPERTIES_PATH_PROPERTY
- See Also:
- Constant Field Values
-
INNER_PATH
public static final java.lang.String INNER_PATH
- See Also:
- Constant Field Values
-
STANDARD_CHARSET
public static final java.nio.charset.Charset STANDARD_CHARSET
-
-
Method Detail
-
load
public static PropertiesLoader load(java.lang.String resource)
Loads properties from specified location- Parameters:
resource- Path to resources in classpath- Returns:
- PropertiesLoader instance
-
getPropertyFilePath
public static java.lang.String getPropertyFilePath()
Get path to ReportPortal configuration file according to Environment Variables and System Properties.- Returns:
- path to ReportPortal configuration file
-
load
public static PropertiesLoader load()
Loads properties from default location- Returns:
- PropertiesLoader instance
- See Also:
INNER_PATH
-
getProperty
public java.lang.String getProperty(java.lang.String propertyName)
Get specified property loaded from properties file and reloaded from from environment variables.- Parameters:
propertyName- Name of property- Returns:
- Property value or null
-
getProperty
public java.lang.String getProperty(ListenerProperty propertyName, java.lang.String defaultValue)
Get specified property- Parameters:
propertyName- Name of propertydefaultValue- Default value- Returns:
- Property value if exists or default value
-
getPropertyAsBoolean
public boolean getPropertyAsBoolean(ListenerProperty propertyName, boolean defaultValue)
Get specified property- Parameters:
propertyName- Name of propertydefaultValue- Default value- Returns:
- Property value if exists or default value
-
getPropertyAsInt
public int getPropertyAsInt(ListenerProperty propertyName, int defaultValue)
Get specified property- Parameters:
propertyName- Name of propertydefaultValue- Default value- Returns:
- property value if present,
defaultValueotherwise
-
getPropertyAsLong
public long getPropertyAsLong(ListenerProperty propertyName, long defaultValue)
Get specified property- Parameters:
propertyName- Name of propertydefaultValue- Default value- Returns:
- property value if present,
defaultValueotherwise
-
getProperty
public java.lang.String getProperty(ListenerProperty propertyName)
Get specified property- Parameters:
propertyName- Name of property- Returns:
- Property value or null
-
getProperties
public java.util.Properties getProperties()
Get all properties loaded from properties file and reloaded from from environment variables.- Returns:
- All properties
-
overrideWith
public void overrideWith(java.util.Properties overrides)
Overrides properties with provided values- Parameters:
overrides- Values to overrides
-
-