|
SMILA 1.0 API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.smila.utils.config.ConfigUtils
public final class ConfigUtils
Helper class to load configs from these locations:
The central config folder is determined in this order from the first non-blank location (the last will always succeed!)
‑Dorg.eclipse.smila.utils.config.root=<path> org.eclipse.smila.utils.config.root=<path> <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.lang.String |
getConfigContent(java.lang.String bundleName,
java.lang.String configPath)
gets content of an configuration file as a string, assuming UTF-8 as the encoding. |
static java.util.List<java.lang.String> |
getConfigEntries(java.lang.String bundleName,
java.lang.String configPath)
Gets the files. |
static java.io.File |
getConfigFile(java.lang.String bundleName,
java.lang.String configPath)
Gets the config file as denoted by the given arguments, or null if it doesnt exist. |
static java.io.File |
getConfigFilePath(java.lang.String bundleName,
java.lang.String configPath)
Gets the File object denoting the path as defined by the given arguments. |
static java.io.File |
getConfigFolder(java.lang.String bundleName,
java.lang.String configPath)
Deprecated. use the more correctly named getConfigFile(String, String) as this may also return
non-directory entries. |
static java.util.Properties |
getConfigProperties(java.lang.String bundleName,
java.lang.String configPath)
Gets the config properties. |
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 for the denoted config file. |
static java.io.File |
getConfigurationFolder()
Gets the root configuration folder as set thru the env var/system propery "org.eclipse.smila.utils.config.root". |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROPERTY_CONFIG_ROOT
| Method Detail |
|---|
public static java.io.InputStream getConfigStream(java.lang.String bundleName,
java.lang.String configPath,
java.lang.String defaultConfigPath)
Note: While this methods supports the bundle name to be an arbitrary string that is not the name of the bundle for "normal" configs the defaultConfigPath will only work if the given bundle name is actually the name of the bundle.
bundleName - the bundle nameconfigPath - the path which may be either relative or absolute. defaultConfigPath - the default config path to a resource that is contained in the bundle itself if the configPath doesnt
resolve to an existing file.
ConfigurationLoadException - if the denoted config file doesnt exist or cannot be opened.
@Deprecated
public static java.io.File getConfigFolder(java.lang.String bundleName,
java.lang.String configPath)
getConfigFile(String, String) as this may also return
non-directory entries.
bundleName - the bundle nameconfigPath - the configuration name
public static java.io.File getConfigFile(java.lang.String bundleName,
java.lang.String configPath)
bundleName - the bundle nameconfigPath - the config path
getConfigFilePath(String, String)
public static java.io.File getConfigFilePath(java.lang.String bundleName,
java.lang.String configPath)
bundleName - the bundle nameconfigPath - the config path
public static java.io.InputStream getConfigStream(java.lang.String bundleName,
java.lang.String configPath)
bundleName - the bundle nameconfigPath - the configuration path
public static java.util.List<java.lang.String> getConfigEntries(java.lang.String bundleName,
java.lang.String configPath)
bundleName - the bundle nameconfigPath - the config name
public static java.io.File getConfigurationFolder()
public static java.util.Properties getConfigProperties(java.lang.String bundleName,
java.lang.String configPath)
throws java.io.IOException
java.io.IOException#getConfigStream(String, String)} as it is called.
public static java.lang.String getConfigContent(java.lang.String bundleName,
java.lang.String configPath)
throws java.io.IOException
java.io.IOException#getConfigStream(String, String)} as it is called.
|
SMILA 1.0 API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||