Class OpenHAB

java.lang.Object
org.openhab.core.OpenHAB

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

    • RUNTIME_DIR_PROG_ARGUMENT

      public static final String RUNTIME_DIR_PROG_ARGUMENT
      The program argument name for setting the runtime directory path
      See Also:
    • 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:
    • 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:
    • DEFAULT_RUNTIME_FOLDER

      public static final String DEFAULT_RUNTIME_FOLDER
      The default runtime directory name
      See Also:
    • DEFAULT_CONFIG_FOLDER

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

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

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

      public static final String SERVICE_CONTEXT_MARKER
      The property to separate service PIDs from their contexts
      See Also:
    • 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:
    • CFG_PACKAGE

      public static final String CFG_PACKAGE
      the configuraton parameter name used for the base package
      See Also:
  • Constructor Details

    • OpenHAB

      public OpenHAB()
  • Method Details

    • 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.
    • getRuntimeFolder

      public static String getRuntimeFolder()
      Returns the runtime folder path name. The runtime folder <openhab-home>/runtime can be overwritten by setting the System property openhab.runtime.
      Returns:
      the runtime folder path name
    • 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