loadOrSaveConfiguration

public final T loadOrSaveConfiguration(Function0<T> defaultSupplier)(source)

Reads the configuration from configurationFile if it exists. If it doesn't exist, it returns the supplied default configuration, and writes it to configurationFile. This doesn't handle IO errors (like inaccessible file), malformed JSON, or encoding and decoding failures.

Return

The configuration from the file, or the default configuration, if the file doesn't exist

Parameters

defaultSupplier

The default configuration supplier