From 021a00400dd53e1050246f0188e3e411d6bcdadb Mon Sep 17 00:00:00 2001 From: North Date: Mon, 22 Oct 2012 23:57:53 +0300 Subject: [PATCH] [CardRepository] changed database file name and location --- Mage.Sets/src/mage/cards/repository/CardRepository.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/repository/CardRepository.java b/Mage.Sets/src/mage/cards/repository/CardRepository.java index 57048a0d6d..bce60392dd 100644 --- a/Mage.Sets/src/mage/cards/repository/CardRepository.java +++ b/Mage.Sets/src/mage/cards/repository/CardRepository.java @@ -33,6 +33,7 @@ import com.j256.ormlite.jdbc.JdbcConnectionSource; import com.j256.ormlite.stmt.QueryBuilder; import com.j256.ormlite.support.ConnectionSource; import com.j256.ormlite.table.TableUtils; +import java.io.File; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; @@ -47,12 +48,16 @@ import java.util.concurrent.Callable; public enum CardRepository { instance; - private static final String JDBC_URL = "jdbc:sqlite:mage.db"; + private static final String JDBC_URL = "jdbc:sqlite:db/cards.db"; private Random random = new Random(); private Dao cardDao; private TreeSet classNames; private CardRepository() { + File file = new File("db"); + if (!file.exists()) { + file.mkdirs(); + } try { ConnectionSource connectionSource = new JdbcConnectionSource(JDBC_URL);