diff --git a/src/com/massivecraft/mcore/store/DbGson.java b/src/com/massivecraft/mcore/store/DbFlatfile.java similarity index 77% rename from src/com/massivecraft/mcore/store/DbGson.java rename to src/com/massivecraft/mcore/store/DbFlatfile.java index 70df4eec..1e81933b 100644 --- a/src/com/massivecraft/mcore/store/DbGson.java +++ b/src/com/massivecraft/mcore/store/DbFlatfile.java @@ -4,7 +4,7 @@ import java.io.File; import com.massivecraft.mcore.util.DiscUtil; -public class DbGson extends DbAbstract +public class DbFlatfile extends DbAbstract { // -------------------------------------------- // // FIELDS @@ -12,14 +12,14 @@ public class DbGson extends DbAbstract public File dir; - protected DriverGson driver; - @Override public DriverGson getDriver() { return driver; } + protected DriverFlatfile driver; + @Override public DriverFlatfile getDriver() { return driver; } // -------------------------------------------- // // CONSTRUCTORS // -------------------------------------------- // - public DbGson(DriverGson driver, File folder) + public DbFlatfile(DriverFlatfile driver, File folder) { this.driver = driver; this.dir = folder; diff --git a/src/com/massivecraft/mcore/store/DriverGson.java b/src/com/massivecraft/mcore/store/DriverFlatfile.java similarity index 85% rename from src/com/massivecraft/mcore/store/DriverGson.java rename to src/com/massivecraft/mcore/store/DriverFlatfile.java index 01eef645..978bda2c 100644 --- a/src/com/massivecraft/mcore/store/DriverGson.java +++ b/src/com/massivecraft/mcore/store/DriverFlatfile.java @@ -15,22 +15,22 @@ import com.massivecraft.mcore.util.DiscUtil; import com.massivecraft.mcore.xlib.gson.JsonElement; import com.massivecraft.mcore.xlib.gson.JsonParser; -public class DriverGson extends DriverAbstract +public class DriverFlatfile extends DriverAbstract { // -------------------------------------------- // // CONSTANTS // -------------------------------------------- // private static final String DOTJSON = ".json"; - public static final String NAME = "gson"; + public static final String NAME = "flatfile"; // -------------------------------------------- // // INSTANCE & CONSTRUCT // -------------------------------------------- // - private static DriverGson i = new DriverGson(); - public static DriverGson get() { return i; } - private DriverGson() { super(NAME); } + private static DriverFlatfile i = new DriverFlatfile(); + public static DriverFlatfile get() { return i; } + private DriverFlatfile() { super(NAME); } // -------------------------------------------- // // OVERRIDE @@ -39,10 +39,10 @@ public class DriverGson extends DriverAbstract @Override public Db getDb(String uri) { - // "gson://" is 7 chars - File folder = new File(uri.substring(7)); + // "flatfile://" is 8+3=11 chars + File folder = new File(uri.substring(NAME.length() + 3)); folder.mkdirs(); - return new DbGson(this, folder); + return new DbFlatfile(this, folder); } @Override @@ -50,7 +50,7 @@ public class DriverGson extends DriverAbstract { Set ret = new LinkedHashSet(); - for (File f : ((DbGson)db).dir.listFiles()) + for (File f : ((DbFlatfile)db).dir.listFiles()) { if ( ! f.isDirectory()) continue; ret.add(f.getName()); diff --git a/src/com/massivecraft/mcore/store/MStore.java b/src/com/massivecraft/mcore/store/MStore.java index 63d6811f..c63f1cde 100644 --- a/src/com/massivecraft/mcore/store/MStore.java +++ b/src/com/massivecraft/mcore/store/MStore.java @@ -31,7 +31,7 @@ public class MStore static { registerDriver(DriverMongo.get()); - registerDriver(DriverGson.get()); + registerDriver(DriverFlatfile.get()); } // -------------------------------------------- //