Java Reference
In-Depth Information
public static Properties getProperties()
Gets the Properties object that defines all system properties.
public static String getProperty(String key)
Returns the value of the system property named in key .
public static String getProperty(String key, String defaultValue)
Returns the value of the system property named in key . If it
has no definition, it returns defaultValue .
public static String setProperty(String key, String value)
Sets the value of the system property named in key to the giv-
en value , returning the previous value or null if the property
was not previously set.
public static String clearProperty(String key)
Removes the system property named in key , returning the
previous value, or null if the property was not previously set.
public static void setProperties(Properties props)
Sets the Properties object that defines all system properties
to be props .
All these methods are security checked and may throw SecurityExcep-
tion . However, being denied access to the entire set of properties does
not necessarily mean you will be denied access to individual properties.
Property values are stored as strings, but the strings can represent oth-
er types, such as integers or booleans. Methods are available to read
properties and decode them into some of the primitive types. These de-
coding methods are static methods of the primitive type's class. Each
 
Search WWH ::




Custom Search