aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/kotlin/App.kt3
-rw-r--r--src/main/kotlin/DatabaseController.kt3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/main/kotlin/App.kt b/src/main/kotlin/App.kt
index c403b5a..0bd15b2 100644
--- a/src/main/kotlin/App.kt
+++ b/src/main/kotlin/App.kt
@@ -13,7 +13,8 @@ import java.net.*
import java.util.logging.*
import kotlin.system.*
-const val fileHome = "files"
+// TODO: Add abstract and secure file home support for windows/BSD/macOS
+val fileHome = if (System.getProperty("os.name") != "Linux") "files" else "/usr/share/kloud/files"
val databaseController = DatabaseController()
val userHandler = UserHandler()
val fileController = FileController()
diff --git a/src/main/kotlin/DatabaseController.kt b/src/main/kotlin/DatabaseController.kt
index 541bd06..8d48008 100644
--- a/src/main/kotlin/DatabaseController.kt
+++ b/src/main/kotlin/DatabaseController.kt
@@ -9,7 +9,8 @@ import org.joda.time.*
import java.sql.*
import java.util.logging.*
-class DatabaseController(dbFileLocation: String = "main.db") {
+class DatabaseController {
+ private val dbFileLocation = if (System.getProperty("os.name") != "Linux") "main.db" else "/usr/share/kloud/main.db"
val db: Database = Database.connect("jdbc:sqlite:$dbFileLocation", "org.sqlite.JDBC")
private val log = Logger.getLogger(this.javaClass.name)