Set dataFolder to data/accounts/

This commit is contained in:
dankl 2020-01-25 21:51:22 +01:00 committed by dankito
parent 8bb2a31a38
commit 7a114b7e0a
3 changed files with 4 additions and 2 deletions

View File

@ -16,7 +16,7 @@ import java.io.File
class MainWindow : View(messages["application.title"]) { 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()) private val presenter = MainWindowPresenter(fints4javaBankingClientCreator(), dataFolder, BankingPersistenceJson(File(dataFolder, "accounts.json")), Base64ServiceJava8(), RouterJavaFx())

View File

@ -98,6 +98,8 @@ open class MainWindowPresenter(
protected open fun readPersistedAccounts() { protected open fun readPersistedAccounts() {
try { try {
dataFolder.mkdirs()
val deserializedAccounts = persister.readPersistedAccounts() val deserializedAccounts = persister.readPersistedAccounts()
deserializedAccounts.forEach { account -> deserializedAccounts.forEach { account ->

View File

@ -45,7 +45,7 @@ class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
val dataFolder = File(this.filesDir, "data") val dataFolder = File(this.filesDir, "data/accounts")
presenter = MainWindowPresenter(fints4javaBankingClientCreator(), dataFolder, presenter = MainWindowPresenter(fints4javaBankingClientCreator(), dataFolder,
BankingPersistenceJson(File(dataFolder, "accounts.json")), Base64ServiceAndroid(), RouterAndroid(this)) BankingPersistenceJson(File(dataFolder, "accounts.json")), Base64ServiceAndroid(), RouterAndroid(this))