]> git.mxchange.org Git - jcore.git/commitdiff
Data path is now configurable
authorRoland Haeder <roland@mxchange.org>
Wed, 12 Aug 2015 10:52:08 +0000 (12:52 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 12 Aug 2015 10:52:08 +0000 (12:52 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/org/mxchange/jcore/BaseFrameworkSystem.java
src/org/mxchange/jcore/database/backend/base64/Base64CsvDatabaseBackend.java

index 2473ac48be90e10a96756b3d33f306c26af87ace..4b959c8da837cf46cd4d775756ffd3cb5f2b2537 100644 (file)
@@ -349,6 +349,7 @@ public class BaseFrameworkSystem implements FrameworkInterface {
                // Init default values:
                // Default database backend
                BaseFrameworkSystem.properties.put("org.mxchange.database.backend.class", "org.mxchange.jcore.database.backend.base64.Base64CsvDatabaseBackend"); //NOI18N
+               BaseFrameworkSystem.properties.put("database.backend.storagepath", "data");
 
                // For MySQL backend
                BaseFrameworkSystem.properties.put("org.mxchange.database.mysql.host", "localhost"); //NOI18N
@@ -845,6 +846,7 @@ public class BaseFrameworkSystem implements FrameworkInterface {
                // Init array
                String[] names = {
                        "database.backend.class",
+                       "database.backend.storagepath",
                        "database.mysql.login",
                        "database.mysql.host",
                        "database.mysql.password",
index 7df0c54cd625ec584170a6cc44e7125b8bc4e685..5a6076caf1f92c3f8c2d316487be438ad78e913d 100644 (file)
@@ -68,7 +68,7 @@ public class Base64CsvDatabaseBackend extends BaseDatabaseBackend implements Dat
                this.setFrontend(frontend);
 
                // Construct file name
-               String fileName = String.format("data/table_%s.b64", tableName); //NOI18N
+               String fileName = String.format("%s/table_%s.b64", this.getProperty("database.backend.storagepath"), tableName); //NOI18N
 
                // Debug message
                this.getLogger().debug(MessageFormat.format("Trying to open file {0} ...", fileName)); //NOI18N