Verified Commit a9f13421 authored by AtjonTV's avatar AtjonTV

FFDB: Check if database File exists when FFDB Instance is created

parent c6d69c6e
......@@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `asDirectory` extension for File
- Status number from `klib.files.Directory2.DirectoryError`
### Fixed
- FFDB now checks if the File exists before writing/reading
### Security
## 4.1.0 - 25.02.2020 - Release 24
......
......@@ -57,6 +57,9 @@ class FFDB(val storageFile: File, val schemaVersion: Int = Version.V2.version) {
* @author Thomas Obernosterer
*/
init {
if (!storageFile.exists()) {
storageFile.createNewFile()
}
when (schemaVersion) {
Version.V2.version -> {
val data = readAllV2(storageFile.objectInputStream())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment