SMILA (incubation) API documentation

org.eclipse.smila.utils.config
Class ConfigUtils

java.lang.Object
  extended by org.eclipse.smila.utils.config.ConfigUtils

public final class ConfigUtils
extends java.lang.Object

Helper class to load configs from these locations:

The configs are attempted to be loaded in the order of the list above.

The central config folder is determined in this order from the first non-blank location (the last will always succeed!)

  1. a System.property set to ‑Dorg.eclipse.smila.utils.config.root=<path>
  2. an environment variable set to org.eclipse.smila.utils.config.root=<path>
  3. <org.eclipse.core.runtime.Platform.getInstallLocation()>/configuration.


Field Summary
static java.lang.String PROPERTY_CONFIG_ROOT
          The Constant PROPERTY_CONFIG_ROOT.
 
Method Summary
static java.util.List<java.lang.String> getConfigEntries(java.lang.String bundleName, java.lang.String configPath)
          Gets the configuration stream.
static java.io.File getConfigFolder(java.lang.String bundleName, java.lang.String configPath)
          Gets the configuration folder.
static java.io.InputStream getConfigStream(java.lang.String bundleName, java.lang.String configPath)
          Gets the configuration stream.
static java.io.InputStream getConfigStream(java.lang.String bundleName, java.lang.String configPath, java.lang.String defaultConfigPath)
          Gets the configuration stream.
static java.io.File getConfigurationFolder()
          Gets the configuration folder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_CONFIG_ROOT

public static final java.lang.String PROPERTY_CONFIG_ROOT
The Constant PROPERTY_CONFIG_ROOT.

See Also:
Constant Field Values
Method Detail

getConfigStream

public static java.io.InputStream getConfigStream(java.lang.String bundleName,
                                                  java.lang.String configPath,
                                                  java.lang.String defaultConfigPath)
Gets the configuration stream.

Parameters:
bundleName - the bundle name
configPath - the config name
defaultConfigPath - the default config name
Returns:
the configuration stream

getConfigFolder

public static java.io.File getConfigFolder(java.lang.String bundleName,
                                           java.lang.String configPath)
Gets the configuration folder.

Parameters:
bundleName - the bundle name
configPath - the configuration name
Returns:
the configuration folder

getConfigStream

public static java.io.InputStream getConfigStream(java.lang.String bundleName,
                                                  java.lang.String configPath)
Gets the configuration stream.

Parameters:
bundleName - the bundle name
configPath - the configuration path
Returns:
the configuration stream

getConfigEntries

public static java.util.List<java.lang.String> getConfigEntries(java.lang.String bundleName,
                                                                java.lang.String configPath)
Gets the configuration stream.

Parameters:
bundleName - the bundle name
configPath - the config name
Returns:
the configuration stream

getConfigurationFolder

public static java.io.File getConfigurationFolder()
Gets the configuration folder.

Returns:
the cONFIGURATION_FOLDER

SMILA (incubation) API documentation