Package de.fu_berlin.inf.dpp

Examples of de.fu_berlin.inf.dpp.FileListDiff


        monitor.beginTask("Compute required Files...", 100);

        if (skipSync)
            return FileListFactory.createEmptyFileList();

        FileListDiff filesToSynchronize = null;
        FileList localFileList = null;
        try {
            localFileList = FileListFactory.createFileList(currentLocalProject,
                null, vcs != null, monitor.newChild(1));
        } catch (CoreException e) {
            e.printStackTrace();
            return FileListFactory.createEmptyFileList();
        }
        SubMonitor childMonitor = monitor.newChild(5,
            SubMonitor.SUPPRESS_ALL_LABELS);
        filesToSynchronize = computeDiff(localFileList, remoteFileList,
            currentLocalProject, projectID, childMonitor);

        List<IPath> missingFiles = filesToSynchronize.getAddedPaths();
        missingFiles.addAll(filesToSynchronize.getAlteredPaths());
        if (missingFiles.isEmpty()) {
            log.debug("Inv" + Utils.prefix(peer)
                + ": There are no files to synchronize.");
            /**
             * We send an empty file list to the host as a notification that we
View Full Code Here


        monitor.beginTask(null, 100);

        try {
            monitor.subTask("Calculating Diff");
            FileListDiff diff = FileListDiff
                .diff(localFileList, remoteFileList);
            monitor.worked(20);

            monitor.subTask("Removing unneeded resources");
            if (!isPartialRemoteProject(projectID))
                diff = diff.removeUnneededResources(currentLocalProject,
                    monitor.newChild(40, SubMonitor.SUPPRESS_ALL_LABELS));

            monitor.subTask("Adding Folders");
            diff = diff.addAllFolders(currentLocalProject,
                monitor.newChild(40, SubMonitor.SUPPRESS_ALL_LABELS));

            return diff;
        } catch (CoreException e) {
            throw new LocalCancellationException(MessageFormat.format(
View Full Code Here

            String projectID = entry.getKey();
            IProject project = entry.getValue();

            if (namePage.overwriteResources(projectID)
                && !preferenceUtils.isAutoReuseExisting()) {
                FileListDiff diff;

                if (!project.isOpen()) {
                    try {
                        project.open(null);
                    } catch (CoreException e) {
                        log.debug(
                            "An error occur while opening the source file", e); //$NON-NLS-1$
                    }
                }

                try {
                    FileList remoteFileList = this.process
                        .getRemoteFileList(projectID);
                    if (sessionManager.getSarosSession().isShared(project)) {
                        FileList sharedFileList = FileListFactory
                            .createFileList(project, sessionManager
                                .getSarosSession().getSharedResources(project),
                                true, null);
                        remoteFileList.getPaths().addAll(
                            sharedFileList.getPaths());
                    }
                    diff = FileListDiff.diff(FileListFactory.createFileList(
                        project, null, true, null), remoteFileList);
                } catch (CoreException e) {
                    MessageDialog.openError(getShell(),
                        "Error computing FileList",
                        "Could not compute local FileList: " + e.getMessage());
                    return false;
                }
                if (this.process.isPartialRemoteProject(projectID))
                    diff.clearRemovedPaths();

                if (!diff.getRemovedPaths().isEmpty()
                    || !diff.getAlteredPaths().isEmpty()) {
                    projectsToOverrideWithDiff.put(project.getName(), diff);
                }

            }
        }
View Full Code Here

                    String message = Messages.AddProjectToSessionWizard_synchronize_projects;

                    String PID = Saros.SAROS;
                    MultiStatus info = new MultiStatus(PID, 1, message, null);
                    for (String projectName : everyThing.keySet()) {
                        FileListDiff diff = everyThing.get(projectName);
                        info.add(new Status(
                            IStatus.INFO,
                            PID,
                            1,
                            MessageFormat
                                .format(
                                    Messages.AddProjectToSessionWizard_files_affected,
                                    projectName), null));
                        for (IPath path : diff.getRemovedPaths()) {
                            info.add(new Status(
                                IStatus.WARNING,
                                PID,
                                1,
                                MessageFormat
                                    .format(
                                        Messages.AddProjectToSessionWizard_file_toRemove,
                                        path.toOSString()), null));
                        }
                        for (IPath path : diff.getAlteredPaths()) {
                            info.add(new Status(
                                IStatus.WARNING,
                                PID,
                                1,
                                MessageFormat
                                    .format(
                                        Messages.AddProjectToSessionWizard_file_overwritten,
                                        path.toOSString()), null));
                        }
                        for (IPath path : diff.getAddedPaths()) {
                            info.add(new Status(
                                IStatus.INFO,
                                PID,
                                1,
                                MessageFormat
View Full Code Here

TOP

Related Classes of de.fu_berlin.inf.dpp.FileListDiff

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.