com.jogamp.common.util
Class PropertyAccess
java.lang.Object
com.jogamp.common.util.PropertyAccess
public class PropertyAccess
- extends Object
Helper routines for accessing properties.
Method Summary |
static void |
addTrustedPrefix(String prefix,
Class<?> certClass)
|
static boolean |
getBooleanProperty(String property,
boolean jnlpAlias,
AccessControlContext acc)
|
static boolean |
getBooleanProperty(String property,
boolean jnlpAlias,
AccessControlContext acc,
boolean defaultValue)
|
static int |
getIntProperty(String property,
boolean jnlpAlias,
AccessControlContext acc,
int defaultValue)
|
static long |
getLongProperty(String property,
boolean jnlpAlias,
AccessControlContext acc,
long defaultValue)
|
static String |
getProperty(String propertyKey,
boolean jnlpAlias,
AccessControlContext acc)
Query the property with the name propertyKey . |
static boolean |
isPropertyDefined(String property,
boolean jnlpAlias,
AccessControlContext acc)
|
static boolean |
isTrusted(String propertyKey)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
jnlp_prefix
public static final String jnlp_prefix
- trusted build-in property prefix 'jnlp.'
- See Also:
- Constant Field Values
javaws_prefix
public static final String javaws_prefix
- trusted build-in property prefix 'javaws.'
- See Also:
- Constant Field Values
PropertyAccess
public PropertyAccess()
addTrustedPrefix
public static final void addTrustedPrefix(String prefix,
Class<?> certClass)
isTrusted
public static final boolean isTrusted(String propertyKey)
getIntProperty
public static final int getIntProperty(String property,
boolean jnlpAlias,
AccessControlContext acc,
int defaultValue)
- See Also:
getProperty(String, boolean, AccessControlContext)
getLongProperty
public static final long getLongProperty(String property,
boolean jnlpAlias,
AccessControlContext acc,
long defaultValue)
- See Also:
getProperty(String, boolean, AccessControlContext)
getBooleanProperty
public static final boolean getBooleanProperty(String property,
boolean jnlpAlias,
AccessControlContext acc)
- See Also:
getProperty(String, boolean, AccessControlContext)
getBooleanProperty
public static final boolean getBooleanProperty(String property,
boolean jnlpAlias,
AccessControlContext acc,
boolean defaultValue)
- See Also:
getProperty(String, boolean, AccessControlContext)
isPropertyDefined
public static final boolean isPropertyDefined(String property,
boolean jnlpAlias,
AccessControlContext acc)
- See Also:
getProperty(String, boolean, AccessControlContext)
getProperty
public static final String getProperty(String propertyKey,
boolean jnlpAlias,
AccessControlContext acc)
throws SecurityException,
NullPointerException,
IllegalArgumentException
- Query the property with the name
propertyKey
.
If jnlpAlias
is true
and the plain propertyKey
could not be resolved, an attempt to resolve the JNLP aliased trusted property is made.
Example: For the propertyName OneTwo
, the jnlp alias name is jnlp.OneTwo
, which is considered trusted.
- Parameters:
propertyKey
- the property name to query.jnlpAlias
- true if a fallback attempt to query the JNLP aliased trusted property shall be made,
otherwise false.acc
- the AccessControlerContext to be used for privileged access to the system property, or null.
- Returns:
- the property value if exists, or null
- Throws:
NullPointerException
- if the property name is null
IllegalArgumentException
- if the property name is of length 0
SecurityException
- if access is not allowed to the given propertyKey
- See Also:
System.getProperty(String)