|
|
|
@ -11,13 +11,13 @@ import java.io.FileWriter
|
|
|
|
|
* Returns WorkplaceConfig; data for config is read from specified file.
|
|
|
|
|
* Throws exceptions FileNotFoundException, SerializationException if file is not found resp. cannot be parsed.
|
|
|
|
|
*/
|
|
|
|
|
internal fun getConfig(filename: String = "WorkplaceConfig.yaml"): DesktopConfig {
|
|
|
|
|
return readFromFile(filename).yamlToType<DesktopConfig>()
|
|
|
|
|
internal fun getConfig(filename: String = "desktop-config.yaml"): DesktopConfig {
|
|
|
|
|
return readFromFile(filename).yamlToType()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Suppress("unused")
|
|
|
|
|
internal fun writeConfig(config: DesktopConfig, fileName: String = "WorkplaceConfigExample.yaml") {
|
|
|
|
|
internal fun writeConfig(config: DesktopConfig, fileName: String = "desktop-config.yaml") {
|
|
|
|
|
FileWriter(fileName).use {
|
|
|
|
|
it.write(
|
|
|
|
|
Yaml.default.encodeToString(
|
|
|
|
@ -26,5 +26,4 @@ internal fun writeConfig(config: DesktopConfig, fileName: String = "WorkplaceCon
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|