Bugfix
This commit is contained in:
parent
4c07228e54
commit
dea0eea5b7
@ -17,7 +17,7 @@ public class ObjectStrangeDbList<T> extends StrangeDbList<T> {
|
|||||||
return indices;
|
return indices;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ObjectStrangeDbList() {
|
protected ObjectStrangeDbList() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ import it.cavallium.strangedb.java.objects.EnhancedObject;
|
|||||||
import it.cavallium.strangedb.java.database.IDatabaseTools;
|
import it.cavallium.strangedb.java.database.IDatabaseTools;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.StringJoiner;
|
import java.util.StringJoiner;
|
||||||
|
|
||||||
public abstract class StrangeDbList<T> extends EnhancedObject {
|
public abstract class StrangeDbList<T> extends EnhancedObject {
|
||||||
|
@ -264,14 +264,22 @@ public class Performance {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void generateDb() throws IOException {
|
public static void generateDb() throws IOException {
|
||||||
dbDataFile = Files.createFile(rootDirectory.resolve("db_data.dat"));
|
dbDataFile = rootDirectory.resolve("db_data.dat");
|
||||||
dbBlocksFile = Files.createFile(rootDirectory.resolve("db_blocks.dat"));
|
dbBlocksFile = rootDirectory.resolve("db_blocks.dat");
|
||||||
dbReferencesFile = Files.createFile(rootDirectory.resolve("db_references.dat"));
|
dbReferencesFile = rootDirectory.resolve("db_references.dat");
|
||||||
|
deleteDbFolders();
|
||||||
|
Files.createFile(dbDataFile);
|
||||||
|
Files.createFile(dbBlocksFile);
|
||||||
|
Files.createFile(dbReferencesFile);
|
||||||
db = new DatabaseJava(dbDataFile, dbBlocksFile, dbReferencesFile);
|
db = new DatabaseJava(dbDataFile, dbBlocksFile, dbReferencesFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void deleteDb() throws IOException {
|
public static void deleteDb() throws IOException {
|
||||||
db.close();
|
db.close();
|
||||||
|
deleteDbFolders();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void deleteDbFolders() throws IOException {
|
||||||
Files.deleteIfExists(dbDataFile);
|
Files.deleteIfExists(dbDataFile);
|
||||||
Files.deleteIfExists(dbBlocksFile);
|
Files.deleteIfExists(dbBlocksFile);
|
||||||
Files.deleteIfExists(dbReferencesFile);
|
Files.deleteIfExists(dbReferencesFile);
|
||||||
|
Loading…
Reference in New Issue
Block a user