Package org.syncany.database.dao

Examples of org.syncany.database.dao.DatabaseXmlSerializer.save()


  protected void saveDeltaDatabase(MemoryDatabase db, File localDatabaseFile) throws IOException {
    logger.log(Level.INFO, "- Saving database to " + localDatabaseFile + " ...");

    DatabaseXmlSerializer dao = new DatabaseXmlSerializer(config.getTransformer());
    dao.save(db.getDatabaseVersions(), localDatabaseFile);
  }

  private void addDirtyData(DatabaseVersion newDatabaseVersion) {
    Iterator<DatabaseVersion> dirtyDatabaseVersions = localDatabase.getDirtyDatabaseVersions();
View Full Code Here


  private File writePurgeFile(DatabaseVersion purgeDatabaseVersion, DatabaseRemoteFile newPurgeDatabaseFile) throws IOException {
    File localPurgeDatabaseFile = config.getCache().getDatabaseFile(newPurgeDatabaseFile.getName());

    DatabaseXmlSerializer xmlSerializer = new DatabaseXmlSerializer(config.getTransformer());
    xmlSerializer.save(Lists.newArrayList(purgeDatabaseVersion), localPurgeDatabaseFile);

    return localPurgeDatabaseFile;
  }

  private DatabaseRemoteFile findNewPurgeRemoteFile(DatabaseVersionHeader purgeDatabaseVersionHeader) throws StorageException {
View Full Code Here

      long lastLocalClientVersion = lastRemoteMergeDatabaseFile.getClientVersion();
      Iterator<DatabaseVersion> lastNDatabaseVersions = localDatabase.getDatabaseVersionsTo(client, lastLocalClientVersion);

      DatabaseXmlSerializer databaseDAO = new DatabaseXmlSerializer(config.getTransformer());
      databaseDAO.save(lastNDatabaseVersions, lastLocalMergeDatabaseFile);

      // Queue files for uploading and deletion
      allToDeleteDatabaseFiles.addAll(toDeleteDatabaseFiles);
      allMergedDatabaseFiles.put(lastLocalMergeDatabaseFile, lastRemoteMergeDatabaseFile);
View Full Code Here

    return db;
  }
 
  public static void writeDatabaseFileToDisk(MemoryDatabase db, File writtenDatabaseFile, Transformer transformer) throws IOException {
    DatabaseXmlSerializer dao = new DatabaseXmlSerializer(transformer);
    dao.save(db.getDatabaseVersions(), writtenDatabaseFile);
  }
 
  public static FileVersion createFileVersion(String path) {
    FileVersion fileVersion = new FileVersion();
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.