ConfigHandler

open fun ConfigHandler(defaultConfig: Config, path: String)

Create a config handler. Writes automatically the default config if not existing.

Parameters

defaultConfig

The default config.

path

The path to the file with the file name and extension. In normal cases should be an ".json" file.

Throws

If file is not read- or writeable an IOException is thrown.


open fun ConfigHandler(defaultConfig: Config, path: String, writeDefaultConfigAutomatically: Boolean)

Create a config handler.

Parameters

defaultConfig

The default config.

path

The path to the file with the file name and extension. In normal cases should be an ".json" file.

writeDefaultConfigAutomatically

If true the default config will be written automatically if no config exists. If this is enabled the config will also be updated every time the handler is created.

Throws

If file is not read- or writeable an IOException is thrown.