From 7a114b7e0a1fa7db432ea4b54eab23c1b7123904 Mon Sep 17 00:00:00 2001 From: dankl Date: Sat, 25 Jan 2020 21:51:22 +0100 Subject: [PATCH] Set dataFolder to data/accounts/ --- .../dankito/banking/ui/javafx/dialogs/mainwindow/MainWindow.kt | 2 +- .../net/dankito/banking/ui/presenter/MainWindowPresenter.kt | 2 ++ .../java/net/dankito/banking/fints4java/android/MainActivity.kt | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/BankingJavaFxApp/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/mainwindow/MainWindow.kt b/BankingJavaFxApp/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/mainwindow/MainWindow.kt index 796ae08a..5df907c4 100755 --- a/BankingJavaFxApp/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/mainwindow/MainWindow.kt +++ b/BankingJavaFxApp/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/mainwindow/MainWindow.kt @@ -16,7 +16,7 @@ import java.io.File class MainWindow : View(messages["application.title"]) { - private val dataFolder = File("data") + private val dataFolder = File("data", "accounts") private val presenter = MainWindowPresenter(fints4javaBankingClientCreator(), dataFolder, BankingPersistenceJson(File(dataFolder, "accounts.json")), Base64ServiceJava8(), RouterJavaFx()) diff --git a/BankingUiCommon/src/main/java/net/dankito/banking/ui/presenter/MainWindowPresenter.kt b/BankingUiCommon/src/main/java/net/dankito/banking/ui/presenter/MainWindowPresenter.kt index 31c957d2..3c4475a3 100644 --- a/BankingUiCommon/src/main/java/net/dankito/banking/ui/presenter/MainWindowPresenter.kt +++ b/BankingUiCommon/src/main/java/net/dankito/banking/ui/presenter/MainWindowPresenter.kt @@ -98,6 +98,8 @@ open class MainWindowPresenter( protected open fun readPersistedAccounts() { try { + dataFolder.mkdirs() + val deserializedAccounts = persister.readPersistedAccounts() deserializedAccounts.forEach { account -> diff --git a/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/MainActivity.kt b/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/MainActivity.kt index 27ccd852..15976a96 100644 --- a/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/MainActivity.kt +++ b/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/MainActivity.kt @@ -45,7 +45,7 @@ class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - val dataFolder = File(this.filesDir, "data") + val dataFolder = File(this.filesDir, "data/accounts") presenter = MainWindowPresenter(fints4javaBankingClientCreator(), dataFolder, BankingPersistenceJson(File(dataFolder, "accounts.json")), Base64ServiceAndroid(), RouterAndroid(this))