Class OpenHAB


  • public class OpenHAB
    extends Object
    Some core static methods that provide information about the running openHAB instance.
    Author:
    Kai Kreuzer - Initial contribution
    • Field Detail

      • USERDATA_DIR_PROG_ARGUMENT

        public static final String USERDATA_DIR_PROG_ARGUMENT
        The program argument name for setting the user data directory path
        See Also:
        Constant Field Values
      • CONFIG_DIR_PROG_ARGUMENT

        public static final String CONFIG_DIR_PROG_ARGUMENT
        The program argument name for setting the main config directory path
        See Also:
        Constant Field Values
      • DEFAULT_CONFIG_FOLDER

        public static final String DEFAULT_CONFIG_FOLDER
        The default main configuration directory name
        See Also:
        Constant Field Values
      • DEFAULT_USERDATA_FOLDER

        public static final String DEFAULT_USERDATA_FOLDER
        The default user data directory name
        See Also:
        Constant Field Values
      • SERVICE_CONTEXT

        public static final String SERVICE_CONTEXT
        The property to recognize a service instance created by a service factory
        See Also:
        Constant Field Values
      • SERVICE_CONTEXT_MARKER

        public static final String SERVICE_CONTEXT_MARKER
        The property to separate service PIDs from their contexts
        See Also:
        Constant Field Values
      • ADDONS_SERVICE_PID

        public static final String ADDONS_SERVICE_PID
        the service pid used for the definition of the base package and add-ons
        See Also:
        Constant Field Values
      • CFG_PACKAGE

        public static final String CFG_PACKAGE
        the configuraton parameter name used for the base package
        See Also:
        Constant Field Values
    • Constructor Detail

      • OpenHAB

        public OpenHAB()
    • Method Detail

      • getVersion

        public static String getVersion()
        Returns the current openHAB version, retrieving the information from the core bundle version.
        Returns:
        the openHAB runtime version
      • buildString

        public static String buildString()
        Provides the build number as it can be found in the version.properties file.
        Returns:
        The build string or "Unknown Build No." if none can be identified.
      • getConfigFolder

        public static String getConfigFolder()
        Returns the configuration folder path name. The main config folder <openhab-home>/conf can be overwritten by setting the System property openhab.conf.
        Returns:
        the configuration folder path name
      • getUserDataFolder

        public static String getUserDataFolder()
        Returns the user data folder path name. The main user data folder <openhab-home>/userdata can be overwritten by setting the System property openhab.userdata.
        Returns:
        the user data folder path name