if (winningVersionToLocalVersionComparison.equals()) { // Local file = local version = winning version!
logger.log(Level.INFO, " -> (8) Equals: Nothing to do, local file equals local version equals winning version: local file = "+localLastFile+", local version = "+localLastVersion+", winning version = "+winningLastVersion);
}
else if (winningVersionToLocalVersionComparison.getFileChanges().contains(FileChange.DELETED)) {
FileSystemAction action = new ChangeFileSystemAction(config, localLastVersion, winningLastVersion, winnersDatabase);
fileSystemActions.add(action);
logger.log(Level.INFO, " -> (9) Content changed: Local file does not exist, but it should: local file = "+localLastFile+", local version = "+localLastVersion+", winning version = "+winningLastVersion);
logger.log(Level.INFO, " -> "+action);
changeSet.getChangedFiles().add(winningLastVersion.getPath());
}
else if (winningVersionToLocalVersionComparison.getFileChanges().contains(FileChange.NEW)) {
FileSystemAction action = new DeleteFileSystemAction(config, localLastVersion, winningLastVersion, winnersDatabase);
fileSystemActions.add(action);
logger.log(Level.INFO, " -> (10) Local file is exists, but should not: local file = "+localLastFile+", local version = "+localLastVersion+", winning version = "+winningLastVersion);
logger.log(Level.INFO, " -> "+action);
changeSet.getDeletedFiles().add(winningLastVersion.getPath());
}
else if (winningVersionToLocalVersionComparison.getFileChanges().contains(FileChange.CHANGED_LINK_TARGET)) {
FileSystemAction action = new NewSymlinkFileSystemAction(config, winningLastVersion, winnersDatabase);
fileSystemActions.add(action);
logger.log(Level.INFO, " -> (11) Changed link target: local file has a different link target: local file = "+localLastFile+", local version = "+localLastVersion+", winning version = "+winningLastVersion);
logger.log(Level.INFO, " -> "+action);
changeSet.getNewFiles().add(winningLastVersion.getPath());
}
else if (!contentChanged && (winningVersionToLocalVersionComparison.getFileChanges().contains(FileChange.CHANGED_LAST_MOD_DATE)
|| winningVersionToLocalVersionComparison.getFileChanges().contains(FileChange.CHANGED_ATTRIBUTES)
|| winningVersionToLocalVersionComparison.getFileChanges().contains(FileChange.CHANGED_PATH))) {
FileSystemAction action = new RenameFileSystemAction(config, localLastVersion, winningLastVersion, winnersDatabase);
fileSystemActions.add(action);
logger.log(Level.INFO, " -> (12) Rename / Changed file attributes: Local file has different file attributes: local file = "+localLastFile+", local version = "+localLastVersion+", winning version = "+winningLastVersion);
logger.log(Level.INFO, " -> "+action);
changeSet.getChangedFiles().add(winningLastVersion.getPath());
}
else { // Content changed
FileSystemAction action = new ChangeFileSystemAction(config, localLastVersion, winningLastVersion, winnersDatabase);
fileSystemActions.add(action);
logger.log(Level.INFO, " -> (13) Content changed: Local file differs from winning version: local file = "+localLastFile+", local version = "+localLastVersion+", winning version = "+winningLastVersion);
logger.log(Level.INFO, " -> "+action);