Package com.jogamp.common.util
Class PropertyAccess
- java.lang.Object
-
- com.jogamp.common.util.PropertyAccess
-
public class PropertyAccess extends Object
Helper routines for accessing properties.
-
-
Field Summary
Fields Modifier and Type Field Description static String
javaws_prefix
trusted build-in property prefix 'javaws.'static String
jnlp_prefix
trusted build-in property prefix 'jnlp.'
-
Constructor Summary
Constructors Constructor Description PropertyAccess()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static void
addTrustedPrefix(String prefix)
static boolean
getBooleanProperty(String property, boolean jnlpAlias)
static boolean
getBooleanProperty(String property, boolean jnlpAlias, boolean defaultValue)
static int
getIntProperty(String property, boolean jnlpAlias, int defaultValue)
static long
getLongProperty(String property, boolean jnlpAlias, long defaultValue)
static String
getProperty(String propertyKey, boolean jnlpAlias)
Query the property with the namepropertyKey
.static String
getProperty(String propertyKey, boolean jnlpAlias, String defaultValue)
static boolean
isPropertyDefined(String property, boolean jnlpAlias)
static boolean
isTrusted(String propertyKey)
-
-
-
Field Detail
-
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
-
-
Method Detail
-
addTrustedPrefix
protected static final void addTrustedPrefix(String prefix) throws AccessControlException
- Parameters:
prefix
- New prefix to be registered as trusted.- Throws:
AccessControlException
- as thrown bySecurityUtil.checkAllPermissions()
.
-
isTrusted
public static final boolean isTrusted(String propertyKey)
-
getIntProperty
public static final int getIntProperty(String property, boolean jnlpAlias, int defaultValue)
- See Also:
getProperty(String, boolean)
-
getLongProperty
public static final long getLongProperty(String property, boolean jnlpAlias, long defaultValue)
- See Also:
getProperty(String, boolean)
-
getBooleanProperty
public static final boolean getBooleanProperty(String property, boolean jnlpAlias)
- See Also:
getProperty(String, boolean)
-
getBooleanProperty
public static final boolean getBooleanProperty(String property, boolean jnlpAlias, boolean defaultValue)
- See Also:
getProperty(String, boolean)
-
isPropertyDefined
public static final boolean isPropertyDefined(String property, boolean jnlpAlias)
- See Also:
getProperty(String, boolean)
-
getProperty
public static final String getProperty(String propertyKey, boolean jnlpAlias) throws SecurityException, NullPointerException, IllegalArgumentException
Query the property with the namepropertyKey
.If
jnlpAlias
istrue
and the plainpropertyKey
could not be resolved, an attempt to resolve the JNLP aliased trusted property is made.
Example: For the propertyNameOneTwo
, the jnlp alias name isjnlp.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.- Returns:
- the property value if exists, or null
- Throws:
NullPointerException
- if the property name is nullIllegalArgumentException
- if the property name is of length 0SecurityException
- if access is not allowed to the givenpropertyKey
- See Also:
System.getProperty(String)
-
getProperty
public static final String getProperty(String propertyKey, boolean jnlpAlias, String defaultValue) throws SecurityException, NullPointerException, IllegalArgumentException
-
-