commit eb7e63fc5ab0334cb2925c8d8c22278bd09268be
parent 58c9137229904c7fc98da0c2d61c2599942483e6
Author: Kevin Corvisier <git@kevincorvisier.fr>
Date: Fri, 6 Jun 2025 05:01:08 +0900
Fix decks downloader not starting when the directory containing the
cache database does not exist
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/main/java/fr/kevincorvisier/mtg/dd/Cache.java b/src/main/java/fr/kevincorvisier/mtg/dd/Cache.java
@@ -2,6 +2,7 @@ package fr.kevincorvisier.mtg.dd;
import java.io.BufferedReader;
import java.io.BufferedWriter;
+import java.io.File;
import java.io.IOException;
import java.io.StringReader;
import java.net.URL;
@@ -37,6 +38,8 @@ public class Cache
if (file == null)
throw new RuntimeException("Property cache.database must be present and have a value");
+ new File(file).getParentFile().mkdirs();
+
connection = DriverManager.getConnection("jdbc:sqlite:" + file);
initialize();
}