|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.hdx.HdxProperties
public class HdxProperties
Manages a collection of properties for the Hdx system. We don't have to do anything particularly elaborate here, other than manage creating a set of properties, initialised from a file in a well-known place, and defaulting to the system properties.
We initialise properties from the property file named by the
system property Hdx.properties
, or if
that does not exist, from the file
Hdx.properties
located in the current directory
(System property user.dir
).
The interface here is patterned after the property methods on
the System
object.
Method Summary | |
---|---|
static Properties |
getProperties()
Determines the current Hdx properties. |
static String |
getProperty(String key)
Gets the Hdx property indicated by the specified key. |
static String |
getProperty(String key,
String def)
Gets the Hdx property indicated by the specified key. |
static String |
setProperty(String key,
String value)
Sets the Hdx property indicated by the specified key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Properties getProperties()
The current set of system
properties for use by the getProperty(java.lang.String)
method is
returned as a Properties
object.
If there is no current set of Hdx properties (that is, this method is being invoked for the first time), a set of Hdx properties is first created and initialized. In all cases, the Hdx properties are defaulted by the System properties.
Properties
object containing all the Hdx
propertiespublic static String getProperty(String key)
If there is no current set of Hdx properties, a set of properties is first created and initialized in the same manner as described above.
Unlike the corresponding method on System
, this
method throws no exceptions, and simply returns
null
on any error.
key
- the name of the Hdx property
public static String getProperty(String key, String def)
If there is no current set of Hdx properties, a set of properties is first created and initialized in the same manner as described above.
Unlike the corresponding method on System
, this
method throws no exceptions, and simply returns
null
on any error.
key
- the name of the Hdx propertydef
- a default value
public static String setProperty(String key, String value) throws HdxException
Unlike the corresponding method on System
, this
method throws only HdxException
on any error.
key
- the name of the Hdx propertyvalue
- the value of the Hdx property
HdxException
- on any error
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |