diff options
author | Florian Dold <florian@dold.me> | 2023-10-09 23:04:43 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-10-09 23:04:43 +0200 |
commit | d30f3a9fcd1c6f930214b649276ea283145141d8 (patch) | |
tree | ad1a85ddbc2eb80369e7268c95d03d588605e7e2 | |
parent | e9fcdd18a153944adfd5d71d71a746c5d4677191 (diff) | |
download | libeufin-0.9.3-dev.23.tar.gz libeufin-0.9.3-dev.23.tar.bz2 libeufin-0.9.3-dev.23.zip |
-commentsv0.9.3-dev.23
-rw-r--r-- | util/src/main/kotlin/TalerConfig.kt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/util/src/main/kotlin/TalerConfig.kt b/util/src/main/kotlin/TalerConfig.kt index 5e765f8f..a8cf0ae0 100644 --- a/util/src/main/kotlin/TalerConfig.kt +++ b/util/src/main/kotlin/TalerConfig.kt @@ -281,6 +281,10 @@ class TalerConfig( return outStr.toString() } + /** + * Read values into the configuration from the given entry point + * filename. Defaults are *not* loaded automatically. + */ fun loadFromFilename(filename: String) { val f = File(filename) val contents = f.readText() @@ -293,6 +297,10 @@ class TalerConfig( } } + /** + * Load configuration defaults from the file system + * and populate the PATHS section based on the installation path. + */ fun loadDefaults() { val installDir = getInstallPath() val baseConfigDir = Paths.get(installDir, "share/$componentName/config.d").toString() @@ -453,6 +461,9 @@ class TalerConfig( return null } + /** + * Guess the path that the component was installed to. + */ fun getInstallPath(): String { // We use the location of the libeufin-bank // binary to determine the installation prefix. |