|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.taverna.raven.appconfig.bootstrap.AbstractConfiguration
net.sf.taverna.raven.appconfig.config.MyGridConfiguration
public class MyGridConfiguration
myGrid configuration, such as services to load in the workbench or LSID provider to use. The configuration is in the file mygrid.properties in the classpath.
The recommended way to get the configuration is to call the static methods getProperties() and getProperty().
For backwards compatability, loadMygridProperties() loads the mygrid properties into the system properties. This was previously done by a static block in org.embl.ebi.escience.scuflui.workbench.Workbench. This method should be called by the main() methods to allow legacy classes to retrieve myGrid configuration.
| Method Summary | |
|---|---|
static void |
flushProperties()
Flush cache of properties. |
static MyGridConfiguration |
getInstance()
Provides access to the singleton instance of the MygridConfiguration, though most access will normally occur through the static methods rather than to the instance directly. |
static java.lang.String |
getProperty(java.lang.String key)
Look up a myGrid property. |
static java.lang.String |
getProperty(java.lang.String key,
java.lang.String def)
Look up a myGrid property. |
static java.io.File |
getStartupDir()
Returns a File representing the Taverna startup directory. |
static java.io.File |
getStartupDir(java.lang.String subfolder)
Returns a File representing a subfolder within the Taverna startup directory. |
static java.io.File |
getUserDir()
Get the user's application directory according to taverna.home. |
static java.io.File |
getUserDir(java.lang.String subDirectory)
Get a subdirectory of the user's application directory. |
static void |
loadMygridProperties()
Deprecated. |
| Methods inherited from class net.sf.taverna.raven.appconfig.bootstrap.AbstractConfiguration |
|---|
flush, getProperties |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static MyGridConfiguration getInstance()
public static java.lang.String getProperty(java.lang.String key)
This is a shorthand for getProperties().getProperty(key).
Use this instead of the legacy System.getProperty("taverna.X"),
which depends on loadMygridProperties() being previously called.
key -
public static java.lang.String getProperty(java.lang.String key,
java.lang.String def)
Like getProperty(String key) - but return def
if the key is unknown.
key - def - Default string if key not found
public static void flushProperties()
@Deprecated public static void loadMygridProperties()
This is provided for backwards compatibility only, as old code relies on System.getProperties() to be prepopulated with the myGrid configuration.
Do not rely on properties to have been loaded globally, instead use MyGridConfiguration.getProperties()
MyGridConfiguration.getProperties()public static java.io.File getUserDir()
The system property taverna.home is assumed to have been
set by Bootstrap.findUserDir() or externally. The directory is created
if needed.
File object representing the user
directory for this application, or null if it could
not be found or created.net.sf.taverna.tools.Bootstrap.findUserDir()public static java.io.File getStartupDir()
public static java.io.File getStartupDir(java.lang.String subfolder)
subfolder -
public static java.io.File getUserDir(java.lang.String subDirectory)
Like getUserDir(), but one level deeper. For instance, getUserDir("conf")
on UNIX would return the file of
/user/myusername/.myapplication/conf and assure that both
.myapplication and conf are created.
subDirectory -
getUserDir()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||