Example #1
0
  public static MemoryDatabase readDatabaseFileFromDisk(File databaseFile, Transformer transformer)
      throws IOException {
    MemoryDatabase db = new MemoryDatabase();

    DatabaseXmlSerializer dao = new DatabaseXmlSerializer(transformer);
    dao.load(db, databaseFile, DatabaseVersionType.DEFAULT);

    return db;
  }
Example #2
0
 public static void writeDatabaseFileToDisk(
     MemoryDatabase db, File writtenDatabaseFile, Transformer transformer) throws IOException {
   DatabaseXmlSerializer dao = new DatabaseXmlSerializer(transformer);
   dao.save(db.getDatabaseVersions(), writtenDatabaseFile);
 }