lucee.Component
commandbox.system.util.SystemSettings
Copyright Since 2014 CommandBox by Ortus Solutions, Corp www.coldbox.org | www.ortussolutions.com I handled accessing environment variables and system properties
| Property Summary | ||||
|---|---|---|---|---|
| type | property | default | serializable | required |
any
|
commandService
|
true
|
false
|
|
| Method Summary | |
|---|---|
any
|
expandDeepSystemSettings(any dataStructure)
Expands placeholders like ${foo} in all deep struct keys and array elements with the matching java prop or env var. |
any
|
expandSystemSettings(string text)
Expands placeholders like ${foo} in a string with the matching java prop or env var. |
array
|
getAllEnvironments()
Return an array of environemnt context with the current one at the top. |
struct
|
getAllEnvironmentsFlattened()
Return a representation of the environemnt context including all parent contexts. |
struct
|
getCurrentEnvironment([any parent='false'])
Return current environment for the shell. |
any
|
getEnv(string key, [any defaultValue])
Retrieve an env value by name. |
any
|
getSystemProperty(string key, [any defaultValue])
Retrieve a Java System property by name. |
any
|
getSystemSetting(string key, [any defaultValue])
Retrieve a Java System property or env value by name. |
any
|
setDeepSystemSettings([any dataStructure], [string prefix='interceptData'])
Take a struct of data and set system settings for each deep key. |
any
|
setSystemProperty(string key, string value)
Set a Java System property. |
any
|
setSystemSetting(string key, string value, [any inParent='false'])
Set a System Setting into the current environment. |
| Methods inherited from class lucee.Component |
|---|
| None |
| Property Detail |
|---|
access - publicrequired - falsereturntype - anyinject - CommandServiceserializable - true| Method Detail |
|---|
Expands placeholders like ${foo} in all deep struct keys and array elements with the matching java prop or env var. Will replace as many place holders that exist, but will skip escaped ones like \${do.not.expand.me} This will recursivley follow all nested structs and arrays.
dataStructure - A string, struct, or array to perform deep replacement on.Expands placeholders like ${foo} in a string with the matching java prop or env var. Will replace as many place holders that exist, but will skip escaped ones like \${do.not.expand.me}
text - The string to do the replacement onReturn an array of environemnt context with the current one at the top
Return a representation of the environemnt context including all parent contexts but not including Java system props and OS env vars flattended into a single struct.
Return current environment for the shell.
parent - Get the parent environmentRetrieve an env value by name.
key - The name of the setting to look up.defaultValue - The default value to use if the key does not exist in the envRetrieve a Java System property by name.
key - The name of the setting to look up.defaultValue - The default value to use if the key does not exist in the system propertiesRetrieve a Java System property or env value by name.
key - The name of the setting to look up.defaultValue - The default value to use if the key does not exist in the system propertiesTake a struct of data and set system settings for each deep key
dataStructure - A string, struct, or array. Initial value should be a struct.prefixSet a Java System property.
key - The name of the setting to set.value - The value to useSet a System Setting into the current environment
key - The name of the setting to set.value - The value to useinParent - Pass true to set the variable in the parent environment