Class PropertiesLoader


  • public class PropertiesLoader
    extends java.lang.Object
    Load ReportPortal launch start properties
    • Field Detail

      • PROPERTIES_PATH_PROPERTY

        public static final java.lang.String PROPERTIES_PATH_PROPERTY
        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 property
        defaultValue - 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 property
        defaultValue - 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 property
        defaultValue - Default value
        Returns:
        property value if present, defaultValue otherwise
      • getPropertyAsLong

        public long getPropertyAsLong​(ListenerProperty propertyName,
                                      long defaultValue)
        Get specified property
        Parameters:
        propertyName - Name of property
        defaultValue - Default value
        Returns:
        property value if present, defaultValue otherwise
      • 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