getProperty

fun getProperty(key: String, def: String? = null): String?

ported from java.lang.System.getProperty() but implementation is EnvVar

Gets the system property indicated by the specified key.

First, if there is a security manager, its checkPropertyAccess method is called with the key as its argument.

If there is no current set of system properties, a set of system properties is first created and initialized in the same manner as for the getProperties method.

Return

the string value of the system property, or the default value if there is no property with that key.

Parameters

key

the name of the system property.

def

a default value.

See also

.setProperty

java.lang.SecurityManager.checkPropertyAccess
java.lang.System.getProperties

Throws

SecurityException

if a security manager exists and its checkPropertyAccess method doesn't allow access to the specified system property.

if key is null.

if key is empty.