Package org.syncany.plugins.transfer.files

Examples of org.syncany.plugins.transfer.files.RemoteFile


  private void uploadAndMoveToTempLocation() throws StorageException {
    TransactionStats stats = gatherTransactionStats();
    int uploadFileIndex = 0;

    for (ActionTO action : transactionTO.getActions()) {
      RemoteFile tempRemoteFile = action.getTempRemoteFile();

      if (action.getType().equals(ActionTO.TYPE_UPLOAD)) {
        File localFile = action.getLocalTempLocation();
        long localFileSize = localFile.length();

        eventBus.post(new UpUploadFileInTransactionSyncExternalEvent(config.getLocalDir().getAbsolutePath(), ++uploadFileIndex,
            stats.totalUploadFileCount, localFileSize, stats.totalUploadSize));

        logger.log(Level.INFO, "- Uploading {0} to temp. file {1} ...", new Object[] { localFile, tempRemoteFile });
        transferManager.upload(localFile, tempRemoteFile);
      }
      else if (action.getType().equals(ActionTO.TYPE_DELETE)) {
        RemoteFile remoteFile = action.getRemoteFile();

        try {
          logger.log(Level.INFO, "- Moving {0} to temp. file {1} ...", new Object[] { remoteFile, tempRemoteFile });
          transferManager.move(remoteFile, tempRemoteFile);
        }
View Full Code Here


  }

  private void moveToFinalLocation() throws StorageException {
    for (ActionTO action : transactionTO.getActions()) {
      if (action.getType().equals(ActionTO.TYPE_UPLOAD)) {
        RemoteFile tempRemoteFile = action.getTempRemoteFile();
        RemoteFile finalRemoteFile = action.getRemoteFile();

        logger.log(Level.INFO, "- Moving temp. file {0} to final location {1} ...", new Object[] { tempRemoteFile, finalRemoteFile });
        transferManager.move(tempRemoteFile, finalRemoteFile);
      }
    }
View Full Code Here

    // be cleaned up by CleanUp and download will not download these, because
    // they are not in any transaction file.

    for (ActionTO action : transactionTO.getActions()) {
      if (action.getType().equals(ActionTO.TYPE_DELETE)) {
        RemoteFile tempRemoteFile = action.getTempRemoteFile();

        logger.log(Level.INFO, "- Deleting temp. file {0}  ...", new Object[] { tempRemoteFile });
        transferManager.delete(tempRemoteFile);
      }
    }
View Full Code Here

      logger.log(Level.INFO, "   + Deleting remote file " + toDeleteRemoteFile + " ...");
      remoteTransaction.delete(toDeleteRemoteFile);
    }

    for (File lastLocalMergeDatabaseFile : allMergedDatabaseFiles.keySet()) {
      RemoteFile lastRemoteMergeDatabaseFile = allMergedDatabaseFiles.get(lastLocalMergeDatabaseFile);

      logger.log(Level.INFO, "   + Uploading new file {0} from local file {1} ...", new Object[] { lastRemoteMergeDatabaseFile,
          lastLocalMergeDatabaseFile });

      remoteTransaction.upload(lastLocalMergeDatabaseFile, lastRemoteMergeDatabaseFile);
View Full Code Here

TOP

Related Classes of org.syncany.plugins.transfer.files.RemoteFile

Copyright © 2018 www.massapicom. 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.