config / org.apache.tuweni.config / Configuration / fromToml

fromToml

open static fun fromToml(toml: String): Configuration (source)

Read a configuration from a TOML-formatted string.

Parameters

toml - A TOML-formatted string.

Return
A Configuration loaded from the TOML file.

open static fun fromToml(toml: String, @Nullable schema: Schema?): Configuration (source)

Read a configuration from a TOML-formatted string, associated with a validation schema.

Parameters

toml - A TOML-formatted string.

schema - The validation schema for the configuration.

Return
A Configuration loaded from the TOML file.

open static fun fromToml(file: Path): Configuration (source)

Loads a configuration from a TOML-formatted file.

Parameters

file - The path of the TOML-formatted configuration file.

Exceptions

NoSuchFileException - If the file could not be found.

IOException - If an IO error occurs.

Return
A Configuration loaded from the TOML file.

open static fun fromToml(file: Path, @Nullable schema: Schema?): Configuration (source)

Loads a configuration from a file, associated with a validation schema.

Parameters

file - The path of the TOML-formatted configuration file.

schema - The validation schema for the configuration.

Exceptions

NoSuchFileException - If the file could not be found.

IOException - If an IO error occurs.

Return
A Configuration loaded from the TOML file.

open static fun fromToml(is: InputStream): Configuration (source)

Loads a configuration from a TOML-formatted file.

Parameters

is - An input stream providing TOML-formatted configuration.

Exceptions

IOException - If an IO error occurs.

Return
A Configuration loaded from the TOML file.

open static fun fromToml(is: InputStream, @Nullable schema: Schema?): Configuration (source)

Loads a configuration from a file, associated with a validation schema.

Parameters

is - An input stream providing TOML-formatted configuration.

schema - The validation schema for the configuration.

Exceptions

IOException - If an IO error occurs.

Return
A Configuration loaded from the TOML file.