View | Details | Raw Unified | Return to bug 306573 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/core/internal/resources/Project.java (-4 / +4 lines)
Lines 28-33 Link Here
28
import org.eclipse.osgi.util.NLS;
28
import org.eclipse.osgi.util.NLS;
29
29
30
public class Project extends Container implements IProject {
30
public class Project extends Container implements IProject {
31
	
32
	private URI snapshotPath = null;
31
33
32
	protected Project(IPath path, Workspace container) {
34
	protected Project(IPath path, Workspace container) {
33
		super(path, container);
35
		super(path, container);
Lines 835-843 Link Here
835
				throw new CoreException(status);
837
				throw new CoreException(status);
836
			}
838
			}
837
			// copy the snapshot from the URI into the project metadata
839
			// copy the snapshot from the URI into the project metadata
838
			IPath snapshotPath = workspace.getMetaArea().getRefreshLocationFor(this);
840
			snapshotPath = snapshotLocation;
839
			IFileStore snapshotFileStore = EFS.getStore(org.eclipse.core.filesystem.URIUtil.toURI(snapshotPath));
840
			EFS.getStore(snapshotLocation).copy(snapshotFileStore, EFS.OVERWRITE, monitor);
841
		}
841
		}
842
	}
842
	}
843
	/* (non-Javadoc)
843
	/* (non-Javadoc)
Lines 947-953 Link Here
947
					boolean refreshed = false;
947
					boolean refreshed = false;
948
					if (!used) {
948
					if (!used) {
949
						refreshed = workspace.getSaveManager().restoreFromRefreshSnapshot(
949
						refreshed = workspace.getSaveManager().restoreFromRefreshSnapshot(
950
								this, Policy.subMonitorFor(monitor, Policy.opWork * 20 / 100));
950
								this, snapshotPath, Policy.subMonitorFor(monitor, Policy.opWork * 20 / 100));
951
						if (refreshed) {	// account for the refresh work
951
						if (refreshed) {	// account for the refresh work
952
							monitor.worked(Policy.opWork * 60 / 100);
952
							monitor.worked(Policy.opWork * 60 / 100);
953
						}
953
						}
(-)src/org/eclipse/core/internal/resources/SaveManager.java (-12 / +11 lines)
Lines 11-27 Link Here
11
 *******************************************************************************/
11
 *******************************************************************************/
12
package org.eclipse.core.internal.resources;
12
package org.eclipse.core.internal.resources;
13
13
14
import org.eclipse.core.runtime.OperationCanceledException;
15
16
import org.eclipse.core.filesystem.IFileStore;
17
18
import org.eclipse.core.filesystem.EFS;
19
20
import java.net.URI;
21
22
import java.io.*;
14
import java.io.*;
15
import java.net.URI;
23
import java.util.*;
16
import java.util.*;
24
import java.util.zip.*;
17
import java.util.zip.*;
18
import org.eclipse.core.filesystem.EFS;
19
import org.eclipse.core.filesystem.IFileStore;
25
import org.eclipse.core.internal.events.*;
20
import org.eclipse.core.internal.events.*;
26
import org.eclipse.core.internal.localstore.*;
21
import org.eclipse.core.internal.localstore.*;
27
import org.eclipse.core.internal.utils.*;
22
import org.eclipse.core.internal.utils.*;
Lines 725-736 Link Here
725
	 * and <code>false</code> if the refresh snapshot was not found or could not be opened.
720
	 * and <code>false</code> if the refresh snapshot was not found or could not be opened.
726
	 * @exception CoreException if an error occurred reading the snapshot file.
721
	 * @exception CoreException if an error occurred reading the snapshot file.
727
	 */
722
	 */
728
	protected boolean restoreFromRefreshSnapshot(Project project,
723
	protected boolean restoreFromRefreshSnapshot(Project project, URI snapshotLocation,
729
			IProgressMonitor monitor) throws CoreException {
724
			IProgressMonitor monitor) throws CoreException {
730
		boolean status = true;
725
		boolean status = true;
731
		IPath snapshotPath = workspace.getMetaArea().getRefreshLocationFor(project);
726
		//IPath snapshotPath = workspace.getMetaArea().getRefreshLocationFor(project);
732
		java.io.File snapshotFile = snapshotPath.toFile();
727
		//java.io.File snapshotFile = snapshotPath.toFile();
733
		if (!snapshotFile.exists())
728
		if (snapshotLocation==null) {
729
			return false;
730
		}
731
		java.io.File snapshotFile = EFS.getStore(snapshotLocation).toLocalFile(EFS.NONE, null);
732
		if (snapshotFile==null || !snapshotFile.exists())
734
			return false;
733
			return false;
735
		if (Policy.DEBUG_RESTORE)
734
		if (Policy.DEBUG_RESTORE)
736
			System.out.println("Restore project " + project.getFullPath() + ": starting..."); //$NON-NLS-1$ //$NON-NLS-2$
735
			System.out.println("Restore project " + project.getFullPath() + ": starting..."); //$NON-NLS-1$ //$NON-NLS-2$

Return to bug 306573