Environment

interface Environment

Interface for Environment variables, that can be mocked for testing purposes.

The Companion object provides the default implementation actually using the system environment variables.

Inheritors

Types

Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard

Returns the TEMP folder of the system based on this Environment variables (that could be mocked)

Link copied to clipboard

Returns the HOME path for the user executing this program based on the Environment variables (that could be mocked)

Functions

Link copied to clipboard

Expands the str replacing ~ with the user home

Link copied to clipboard
abstract operator fun get(key: String): String?

Returns the String value or null of the environment provided by key (it is case insensitive)

Link copied to clipboard
abstract fun getAll(): Map<String, String>

Gets the full list of environment variables, keeping its case-sensitivity.

Link copied to clipboard
abstract operator fun set(key: String, value: String)

Sets the value for the environment key