From e3f65d21922dc861942977f48c68b17183c61d3a Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Sun, 28 Mar 2021 01:35:46 +0430 Subject: [PATCH] fix URI exception --- .../ir/armor/tachidesk/server/ServerSetup.kt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/server/src/main/kotlin/ir/armor/tachidesk/server/ServerSetup.kt b/server/src/main/kotlin/ir/armor/tachidesk/server/ServerSetup.kt index 084c743..104f793 100644 --- a/server/src/main/kotlin/ir/armor/tachidesk/server/ServerSetup.kt +++ b/server/src/main/kotlin/ir/armor/tachidesk/server/ServerSetup.kt @@ -37,7 +37,7 @@ val androidCompat by lazy { AndroidCompat() } fun applicationSetup() { // register server config GlobalConfigManager.registerModule( - ServerConfig.register(GlobalConfigManager.config) + ServerConfig.register(GlobalConfigManager.config) ) // set application wide logging level @@ -47,10 +47,10 @@ fun applicationSetup() { // make dirs we need listOf( - applicationDirs.dataRoot, - applicationDirs.extensionsRoot, - "${applicationDirs.extensionsRoot}/icon", - applicationDirs.thumbnailsRoot + applicationDirs.dataRoot, + applicationDirs.extensionsRoot, + "${applicationDirs.extensionsRoot}/icon", + applicationDirs.thumbnailsRoot ).forEach { File(it).mkdirs() } @@ -59,9 +59,7 @@ fun applicationSetup() { try { val dataConfFile = File("${applicationDirs.dataRoot}/server.conf") if (!dataConfFile.exists()) { - val inpStream = File( - Main::class.java.getResource("/server-reference.conf").toURI() - ).inputStream() + val inpStream = Main::class.java.getResourceAsStream("/server-reference.conf") val outStream = dataConfFile.outputStream() inpStream.copyTo(outStream) @@ -69,7 +67,9 @@ fun applicationSetup() { inpStream.close() outStream.close() } - } catch (e: Exception) {} + } catch (e: Exception) { + e.printStackTrace() + } makeDataBaseTables()