tuweni / 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 - String!: A TOML-formatted string.

Return
Configuration!: 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 - String!: A TOML-formatted string.

schema - Schema?: The validation schema for the configuration.

Return
Configuration!: 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 - Path!: The path of the TOML-formatted configuration file.

Exceptions

NoSuchFileException - If the file could not be found.

IOException - If an IO error occurs.

Return
Configuration!: 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 - Path!: The path of the TOML-formatted configuration file.

schema - Schema?: The validation schema for the configuration.

Exceptions

NoSuchFileException - If the file could not be found.

IOException - If an IO error occurs.

Return
Configuration!: 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 - InputStream!: An input stream providing TOML-formatted configuration.

Exceptions

IOException - If an IO error occurs.

Return
Configuration!: 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 - InputStream!: An input stream providing TOML-formatted configuration.

schema - Schema?: The validation schema for the configuration.

Exceptions

IOException - If an IO error occurs.

Return
Configuration!: A Configuration loaded from the TOML file.