APIdia Launch Partner
Top Description Fields Constructors Methods
sun.security.util

public Class SecurityProperties

extends Object
Class Inheritance
Imports
java.security.Security, java.util.Locale

Utility methods for retrieving security and system properties.

Field Summary

Modifier and TypeField and Description
public static final boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

a boolean value corresponding to the value in the System property. If the property value is neither "true" or "false", the default value will be returned.
getBooleanSystemProp
(String
the name of the System property
prop
,
boolean
a default value
def
,
Debug
a Debug object, if null no debug messages will be sent
dbg
)

Convenience method for fetching System property values that are booleans.

public static long

Returns:

the value of the property as a long. If a non-numeric value is supplied, the default value will be returned.
getOverridableLongProp
(String
the property to query
prop
,
long
the default value
defaultValue
,
Debug
a Debug object, if null no debug messages will be sent
dbg
)

A convenience routine for fetching a numeric value from a Security or System property and returning it as a long.

public static String

Returns:

the value of the system or security property
getOverridableProperty
(String
the name of the system or security property
propName
)

Returns the value of the security property propName, which can be overridden by a system property of the same name

public static int

Returns:

an integer value corresponding to the timeout value in the System property in milliseconds. If the property value is empty, negative, or contains non-numeric characters (besides a trailing "s" or "ms") then the default value will be returned. If a negative value for the "def" parameter is supplied, zero will be returned if the property's value does not conform to the allowed syntax.
getTimeoutSystemProp
(String
the name of the System property
prop
,
int
a default value (in milliseconds)
def
,
Debug
a Debug object, if null no debug messages will be sent
dbg
)

Convenience method for fetching System property values that are timeouts.

public static boolean

Returns:

true in case the system or security property "jdk.includeInExceptions" contains refName, false otherwise
includedInExceptions
(String
the category to check
refName
)

Returns true in case the system or security property "jdk.includeInExceptions" contains the category refName

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INCLUDE_JAR_NAME_IN_EXCEPTIONSback to summary
public static final boolean INCLUDE_JAR_NAME_IN_EXCEPTIONS

Constructor Detail

SecurityPropertiesback to summary
public SecurityProperties()

Method Detail

getBooleanSystemPropback to summary
public static boolean getBooleanSystemProp(String prop, boolean def, Debug dbg)

Convenience method for fetching System property values that are booleans.

Parameters
prop:String

the name of the System property

def:boolean

a default value

dbg:Debug

a Debug object, if null no debug messages will be sent

Returns:boolean

a boolean value corresponding to the value in the System property. If the property value is neither "true" or "false", the default value will be returned.

getOverridableLongPropback to summary
public static long getOverridableLongProp(String prop, long defaultValue, Debug dbg)

A convenience routine for fetching a numeric value from a Security or System property and returning it as a long. The value from the property is obtained according to the logic in SecurityProperties#getOverridableProperty(String)

Parameters
prop:String

the property to query

defaultValue:long

the default value

dbg:Debug

a Debug object, if null no debug messages will be sent

Returns:long

the value of the property as a long. If a non-numeric value is supplied, the default value will be returned.

getOverridablePropertyback to summary
public static String getOverridableProperty(String propName)

Returns the value of the security property propName, which can be overridden by a system property of the same name

Parameters
propName:String

the name of the system or security property

Returns:String

the value of the system or security property

getTimeoutSystemPropback to summary
public static int getTimeoutSystemProp(String prop, int def, Debug dbg)

Convenience method for fetching System property values that are timeouts. Accepted timeout values may be purely numeric, a numeric value followed by "s" (both interpreted as seconds), or a numeric value followed by "ms" (interpreted as milliseconds).

Parameters
prop:String

the name of the System property

def:int

a default value (in milliseconds)

dbg:Debug

a Debug object, if null no debug messages will be sent

Returns:int

an integer value corresponding to the timeout value in the System property in milliseconds. If the property value is empty, negative, or contains non-numeric characters (besides a trailing "s" or "ms") then the default value will be returned. If a negative value for the "def" parameter is supplied, zero will be returned if the property's value does not conform to the allowed syntax.

includedInExceptionsback to summary
public static boolean includedInExceptions(String refName)

Returns true in case the system or security property "jdk.includeInExceptions" contains the category refName

Parameters
refName:String

the category to check

Returns:boolean

true in case the system or security property "jdk.includeInExceptions" contains refName, false otherwise