Package org.syncany.operations.down.actions

Examples of org.syncany.operations.down.actions.NewFileSystemAction


    return new DeleteFileSystemAction(createDummyConfig(), firstFileVersion, secondFileVersion, null);
 

  private NewFileSystemAction createNewFileSystemAction(String path, FileType type) throws Exception {
    FileVersion firstFileVersion = createFileVersion(path, type);
    return new NewFileSystemAction(createDummyConfig(), firstFileVersion, null);
  }
View Full Code Here


   
    if (winningFileToVersionComparison.equals()) {
      logger.log(Level.INFO, "     -> (1) Equals: Nothing to do, winning version equals winning file: "+winningLastVersion+" AND "+winningLastFile)
    }
    else if (winningFileToVersionComparison.getFileChanges().contains(FileChange.DELETED)) {         
      FileSystemAction action = new NewFileSystemAction(config, winningLastVersion, winnersDatabase);
      outFileSystemActions.add(action);
     
      logger.log(Level.INFO, "     -> (2) Deleted: Local file does NOT exist, but it should, winning version not known: "+winningLastVersion+" AND "+winningLastFile);
      logger.log(Level.INFO, "     -> "+action);
     
      changeSet.getNewFiles().add(winningLastVersion.getPath());
    }
    else if (winningFileToVersionComparison.getFileChanges().contains(FileChange.NEW)) {
      logger.log(Level.INFO, "     -> (3) New: winning version was deleted, but local exists: "+winningLastVersion+" AND "+winningLastFile);         
      throw new Exception("What happend here?");
    }
    else if (winningFileToVersionComparison.getFileChanges().contains(FileChange.CHANGED_LINK_TARGET)) {         
      FileSystemAction action = new NewSymlinkFileSystemAction(config, winningLastVersion, winnersDatabase);
      outFileSystemActions.add(action);

      logger.log(Level.INFO, "     -> (4) Changed link target: winning file has a different link target: "+winningLastVersion+" AND "+winningLastFile);
      logger.log(Level.INFO, "     -> "+action);
     
      changeSet.getNewFiles().add(winningLastVersion.getPath());
    }
    else if (!contentChanged && (winningFileToVersionComparison.getFileChanges().contains(FileChange.CHANGED_LAST_MOD_DATE)
        || winningFileToVersionComparison.getFileChanges().contains(FileChange.CHANGED_ATTRIBUTES))) { 
     
      FileSystemAction action = new SetAttributesFileSystemAction(config, winningLastVersion, winnersDatabase);
      outFileSystemActions.add(action);

      logger.log(Level.INFO, "     -> (5) Changed file attributes: winning file has different file attributes: "+winningLastVersion+" AND "+winningLastFile);
      logger.log(Level.INFO, "     -> "+action);
     
      changeSet.getNewFiles().add(winningLastVersion.getPath());
    }
    else if (winningFileToVersionComparison.getFileChanges().contains(FileChange.CHANGED_PATH)) {
      logger.log(Level.INFO, "     -> (6) Changed path: winning file has a different path: "+winningLastVersion+" AND "+winningLastFile);         
      throw new Exception("What happend here?");
    }
    else { // Content changed
      FileSystemAction action = new NewFileSystemAction(config, winningLastVersion, winnersDatabase);
      outFileSystemActions.add(action);

      logger.log(Level.INFO, "     -> (7) Content changed: Winning file differs from winning version: "+winningLastVersion+" AND "+winningLastFile);
      logger.log(Level.INFO, "     -> "+action);
     
View Full Code Here

TOP

Related Classes of org.syncany.operations.down.actions.NewFileSystemAction

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.