Moved mkdirs() to getFints4kClientDataFile()

This commit is contained in:
dankito 2020-07-27 16:58:29 +02:00
parent 2d30047c75
commit 12f61b03ef
1 changed files with 5 additions and 3 deletions

View File

@ -176,8 +176,6 @@ open class fints4kBankingClient(
try {
val clientDataFile = getFints4kClientDataFile()
clientDataFile.parent?.mkdirs()
serializer.serializeObject(fints4kCustomer, clientDataFile)
} catch (e: Exception) {
log.error("Could not save customer data for $fints4kCustomer", e)
@ -185,7 +183,11 @@ open class fints4kBankingClient(
}
protected open fun getFints4kClientDataFile(): File {
return File(File(dataFolder, "fints4k-client"), "${bank.bankCode}_${fints4kCustomer.customerId}_$fints4kClientDataFilename")
val folder = File(dataFolder, "fints4k-client")
folder.mkdirs()
return File(folder, "${bank.bankCode}_${fints4kCustomer.customerId}_$fints4kClientDataFilename")
}