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

Collapse All | Expand All

(-)src/org/eclipse/core/internal/resources/LocalMetaArea.java (+17 lines)
Lines 31-36 Link Here
31
	/* package */static final String F_PROJECT_LOCATION = ".location"; //$NON-NLS-1$
31
	/* package */static final String F_PROJECT_LOCATION = ".location"; //$NON-NLS-1$
32
	/* package */static final String F_PROJECTS = ".projects"; //$NON-NLS-1$
32
	/* package */static final String F_PROJECTS = ".projects"; //$NON-NLS-1$
33
	/* package */static final String F_PROPERTIES = ".properties"; //$NON-NLS-1$
33
	/* package */static final String F_PROPERTIES = ".properties"; //$NON-NLS-1$
34
	/* package */static final String F_REFRESH = ".refresh"; //$NON-NLS-1$
34
	/* package */static final String F_ROOT = ".root"; //$NON-NLS-1$
35
	/* package */static final String F_ROOT = ".root"; //$NON-NLS-1$
35
	/* package */static final String F_SAFE_TABLE = ".safetable"; //$NON-NLS-1$
36
	/* package */static final String F_SAFE_TABLE = ".safetable"; //$NON-NLS-1$
36
	/* package */static final String F_SNAP = ".snap"; //$NON-NLS-1$
37
	/* package */static final String F_SNAP = ".snap"; //$NON-NLS-1$
Lines 62-67 Link Here
62
		Workspace.clear(getOldDescriptionLocationFor(target).toFile());
63
		Workspace.clear(getOldDescriptionLocationFor(target).toFile());
63
	}
64
	}
64
65
66
	/**
67
	 * Delete the refresh snapshot once it has been used to open a new project.
68
	 */
69
	public void clearRefresh(IProject target) {
70
		Workspace.clear(getRefreshLocationFor(target).toFile());
71
	}
72
65
	public void create(IProject target) {
73
	public void create(IProject target) {
66
		java.io.File file = locationFor(target).toFile();
74
		java.io.File file = locationFor(target).toFile();
67
		//make sure area is empty
75
		//make sure area is empty
Lines 147-152 Link Here
147
		return locationFor(resource).append(F_PROPERTIES);
155
		return locationFor(resource).append(F_PROPERTIES);
148
	}
156
	}
149
157
158
	/**
159
	 * Returns the path of the file in which to save the refresh snapshot for
160
	 * the given project.
161
	 */
162
	public IPath getRefreshLocationFor(IProject project) {
163
		Assert.isNotNull(project);
164
		return locationFor(project).append(F_REFRESH);
165
	}
166
150
	public IPath getSafeTableLocationFor(String pluginId) {
167
	public IPath getSafeTableLocationFor(String pluginId) {
151
		IPath prefix = metaAreaLocation.append(F_SAFE_TABLE);
168
		IPath prefix = metaAreaLocation.append(F_SAFE_TABLE);
152
		// if the plugin is the resources plugin, we return the master table
169
		// if the plugin is the resources plugin, we return the master table
(-)src/org/eclipse/core/internal/resources/Project.java (-6 / +63 lines)
Lines 9-17 Link Here
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Serge Beauchamp (Freescale Semiconductor) - [229633] Project Path Variable Support
10
 *     Serge Beauchamp (Freescale Semiconductor) - [229633] Project Path Variable Support
11
 * Anton Leherbauer (Wind River) - [198591] Allow Builder to specify scheduling rule
11
 * Anton Leherbauer (Wind River) - [198591] Allow Builder to specify scheduling rule
12
 * Francis Lynch (Wind River) - [301563] Save and load refresh information snapshots
12
 *******************************************************************************/
13
 *******************************************************************************/
13
package org.eclipse.core.internal.resources;
14
package org.eclipse.core.internal.resources;
14
15
16
import org.eclipse.core.runtime.IPath;
17
15
import java.net.URI;
18
import java.net.URI;
16
import java.util.*;
19
import java.util.*;
17
import org.eclipse.core.filesystem.*;
20
import org.eclipse.core.filesystem.*;
Lines 820-825 Link Here
820
	}
823
	}
821
824
822
	/* (non-Javadoc)
825
	/* (non-Javadoc)
826
	 * @see IProject#loadSnapshot(int, URI, IProgressMonitor)
827
	 */
828
	public void loadSnapshot(int options, URI snapshotLocation,
829
			IProgressMonitor monitor) throws CoreException {
830
		if ((options & SNAPSHOT_TREE) != 0) {
831
			// load a snapshot of refresh information when project is opened
832
			if (isOpen()) {
833
				String message = Messages.resources_projectMustNotBeOpen;
834
				MultiStatus status = new MultiStatus(ResourcesPlugin.PI_RESOURCES, IStatus.ERROR, message, null);
835
				throw new CoreException(status);
836
			}
837
			// copy the snapshot from the URI into the project metadata
838
			IPath snapshotPath = workspace.getMetaArea().getRefreshLocationFor(this);
839
			IFileStore snapshotFileStore = EFS.getStore(org.eclipse.core.filesystem.URIUtil.toURI(snapshotPath));
840
			snapshotFileStore.delete(EFS.NONE, monitor);
841
			EFS.getStore(snapshotLocation).copy(snapshotFileStore, options, monitor);
842
		}
843
	}
844
	/* (non-Javadoc)
823
	 * @see IProject#move(IProjectDescription, boolean, IProgressMonitor)
845
	 * @see IProject#move(IProjectDescription, boolean, IProgressMonitor)
824
	 */
846
	 */
825
	public void move(IProjectDescription destination, boolean force, IProgressMonitor monitor) throws CoreException {
847
	public void move(IProjectDescription destination, boolean force, IProgressMonitor monitor) throws CoreException {
Lines 921-934 Link Here
921
				}
943
				}
922
				startup();
944
				startup();
923
				//request a refresh if the project is new and has unknown members on disk
945
				//request a refresh if the project is new and has unknown members on disk
924
				// or restore of the project is not fully succesfull
946
				// or restore of the project is not fully successful
925
				if ((!used && unknownChildren) || !minorIssuesDuringRestore) {
947
				if ((!used && unknownChildren) || !minorIssuesDuringRestore) {
948
					boolean refreshed = false;
949
					if (!used) {
950
						refreshed = workspace.getSaveManager().restoreFromRefreshSnapshot(
951
								this, Policy.subMonitorFor(monitor, Policy.opWork * 20 / 100));
952
						if (refreshed) {	// account for the refresh work
953
							monitor.worked(Policy.opWork * 60 / 100);
954
						}
955
					}
926
					//refresh either in background or foreground
956
					//refresh either in background or foreground
927
					if ((updateFlags & IResource.BACKGROUND_REFRESH) != 0) {
957
					if (!refreshed) {
928
						workspace.refreshManager.refresh(this);
958
						if ((updateFlags & IResource.BACKGROUND_REFRESH) != 0) {
929
						monitor.worked(Policy.opWork * 80 / 100);
959
							workspace.refreshManager.refresh(this);
930
					} else {
960
							monitor.worked(Policy.opWork * 60 / 100);
931
						refreshLocal(IResource.DEPTH_INFINITE, Policy.subMonitorFor(monitor, Policy.opWork * 80 / 100));
961
						} else {
962
							refreshLocal(IResource.DEPTH_INFINITE, Policy.subMonitorFor(monitor, Policy.opWork * 60 / 100));
963
						}
932
					}
964
					}
933
				}
965
				}
934
				//creation of this project may affect overlapping resources
966
				//creation of this project may affect overlapping resources
Lines 1036-1041 Link Here
1036
	}
1068
	}
1037
1069
1038
	/* (non-Javadoc)
1070
	/* (non-Javadoc)
1071
	 * @see IProject#saveSnapshot(int, URI, IProgressMonitor)
1072
	 */
1073
	public void saveSnapshot(int options, URI snapshotLocation,
1074
			IProgressMonitor monitor) throws CoreException {
1075
		if ((options & SNAPSHOT_TREE) != 0) {
1076
			// write a snapshot of refresh information
1077
			monitor = Policy.monitorFor(monitor);
1078
			try {
1079
				String msg = NLS.bind(Messages.resources_copying, getName());
1080
				monitor.beginTask(msg, Policy.totalWork);
1081
				try {
1082
					IProgressMonitor sub = Policy.subMonitorFor(monitor, Policy.opWork / 2, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL);
1083
					workspace.getSaveManager().saveRefreshSnapshot(
1084
							this, snapshotLocation, sub);
1085
					monitor.worked(Policy.opWork / 2);
1086
				} catch (OperationCanceledException e) {
1087
					workspace.getWorkManager().operationCanceled();
1088
					throw e;
1089
				}
1090
			} finally {
1091
				monitor.done();
1092
			}
1093
		}
1094
	}
1095
	/* (non-Javadoc)
1039
	 * @see IProject#setDescription(IProjectDescription, int, IProgressMonitor)
1096
	 * @see IProject#setDescription(IProjectDescription, int, IProgressMonitor)
1040
	 */
1097
	 */
1041
	public void setDescription(IProjectDescription description, int updateFlags, IProgressMonitor monitor) throws CoreException {
1098
	public void setDescription(IProjectDescription description, int updateFlags, IProgressMonitor monitor) throws CoreException {
(-)src/org/eclipse/core/internal/resources/SaveManager.java (-1 / +139 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-17 Link Here
7
 * 
7
 * 
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Francis Lynch (Wind River) - add support for snapshot of project tree
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.core.internal.resources;
12
package org.eclipse.core.internal.resources;
12
13
14
import org.eclipse.core.filesystem.IFileStore;
15
16
import org.eclipse.core.filesystem.EFS;
17
18
import java.net.URI;
19
13
import java.io.*;
20
import java.io.*;
14
import java.util.*;
21
import java.util.*;
22
import java.util.zip.*;
15
import org.eclipse.core.internal.events.*;
23
import org.eclipse.core.internal.events.*;
16
import org.eclipse.core.internal.localstore.*;
24
import org.eclipse.core.internal.localstore.*;
17
import org.eclipse.core.internal.utils.*;
25
import org.eclipse.core.internal.utils.*;
Lines 708-713 Link Here
708
	}
716
	}
709
717
710
	/**
718
	/**
719
	 * Restores the contents of this project from a refresh snapshot, if possible.
720
	 * Throws an exception if the snapshot is found but an error occurs when reading
721
	 * the file.
722
	 * @return <code><code>true</code> if the project data was restored successfully,
723
	 * and <code>false</code> if the refresh snapshot was not found or could not be opened.
724
	 * @exception CoreException if an error occurred reading the snapshot file.
725
	 */
726
	protected boolean restoreFromRefreshSnapshot(Project project,
727
			IProgressMonitor monitor) throws CoreException {
728
		boolean status = true;
729
		IPath snapshotPath = workspace.getMetaArea().getRefreshLocationFor(project);
730
		java.io.File snapshotFile = snapshotPath.toFile();
731
		if (!snapshotFile.exists())
732
			return false;
733
		if (Policy.DEBUG_RESTORE)
734
			System.out.println("Restore project " + project.getFullPath() + ": starting..."); //$NON-NLS-1$ //$NON-NLS-2$
735
		long start = System.currentTimeMillis();
736
		monitor = Policy.monitorFor(monitor);
737
		try {
738
			monitor.beginTask("", 40); //$NON-NLS-1$
739
			status = restoreTreeFromRefreshSnapshot(project,
740
					snapshotFile, Policy.subMonitorFor(monitor, 40));
741
			if (status) {
742
				// load the project description and set internal description
743
				ProjectDescription description = workspace.getFileSystemManager().read(project, true);
744
				project.internalSetDescription(description, false);
745
				workspace.getMetaArea().clearRefresh(project);
746
			}
747
		} finally {
748
			monitor.done();
749
		}
750
		if (Policy.DEBUG_RESTORE)
751
			System.out.println("Restore project " + project.getFullPath() + ": " + (System.currentTimeMillis() - start) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
752
		return status;
753
	}
754
755
	/**
711
	 * Reads the markers which were originally saved
756
	 * Reads the markers which were originally saved
712
	 * for the tree rooted by the given resource.
757
	 * for the tree rooted by the given resource.
713
	 */
758
	 */
Lines 970-975 Link Here
970
		return true;
1015
		return true;
971
	}
1016
	}
972
	
1017
	
1018
	/**
1019
	 * Restores a tree saved as a refresh snapshot to a specified URI.
1020
	 * @return <code>true</code> if the snapshot exists, <code>false</code> otherwise.
1021
	 * @exception CoreException if the project could not be restored.
1022
	 */
1023
	protected boolean restoreTreeFromRefreshSnapshot(Project project,
1024
			java.io.File snapshotFile, IProgressMonitor monitor) throws CoreException {
1025
		long start = System.currentTimeMillis();
1026
		monitor = Policy.monitorFor(monitor);
1027
		String message;
1028
		IPath snapshotPath = null;
1029
		try {
1030
			monitor.beginTask("", Policy.totalWork); //$NON-NLS-1$
1031
			InputStream snapIn = new FileInputStream(snapshotFile);
1032
			ZipInputStream zip = new ZipInputStream(snapIn);
1033
			ZipEntry treeEntry = zip.getNextEntry();
1034
			if (treeEntry == null || !treeEntry.getName().equals("resource-index.tree")) { //$NON-NLS-1$
1035
				zip.close();
1036
				return false;
1037
			}
1038
			DataInputStream input = new DataInputStream(zip);
1039
			try {
1040
				WorkspaceTreeReader reader = WorkspaceTreeReader.getReader(workspace, input.readInt());
1041
				reader.readTree(project, input, Policy.subMonitorFor(monitor, Policy.totalWork));
1042
			} finally {
1043
				input.close();
1044
				zip.close();
1045
			}
1046
		} catch (IOException e) {
1047
			snapshotPath = new Path(snapshotFile.getPath());
1048
			message = NLS.bind(Messages.resources_readMeta, snapshotPath);
1049
			throw new ResourceException(IResourceStatus.FAILED_READ_METADATA, snapshotPath, message, e);
1050
		} finally {
1051
			monitor.done();
1052
		}
1053
		if (Policy.DEBUG_RESTORE_TREE) {
1054
			System.out.println("Restore Tree for " + project.getFullPath() + ": " + (System.currentTimeMillis() - start) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
1055
		}
1056
		return true;
1057
	}
1058
	
973
	class InternalMonitorWrapper extends ProgressMonitorWrapper{
1059
	class InternalMonitorWrapper extends ProgressMonitorWrapper{
974
		private boolean ignoreCancel;
1060
		private boolean ignoreCancel;
975
		
1061
		
Lines 1162-1167 Link Here
1162
	}
1248
	}
1163
1249
1164
	/**
1250
	/**
1251
	 * Writes a snapshot of project refresh information to the specified
1252
	 * location.
1253
	 * @param project the project to write a refresh snapshot for
1254
	 * @param monitor progress monitor
1255
	 * @exception CoreException if there is a problem writing the snapshot.
1256
	 */
1257
	public void saveRefreshSnapshot(Project project, URI snapshotLocation,
1258
			IProgressMonitor monitor) throws CoreException {
1259
		IFileStore store = EFS.getStore(snapshotLocation);
1260
		IPath snapshotPath = new Path(snapshotLocation.getPath());
1261
		OutputStream snapOut = store.openOutputStream(EFS.NONE, monitor);
1262
		java.io.File tmpTree = null;
1263
		try {
1264
			tmpTree = java.io.File.createTempFile("tmp", ".tree");	//$NON-NLS-1$//$NON-NLS-2$
1265
		} catch (IOException e) {
1266
			throw new ResourceException(IResourceStatus.FAILED_WRITE_LOCAL,
1267
					snapshotPath, Messages.resources_copyProblem, e);
1268
		}
1269
		ZipOutputStream out = null;
1270
		try {
1271
			FileOutputStream fis = new FileOutputStream(tmpTree);
1272
			DataOutputStream output = new DataOutputStream(fis);
1273
			try {
1274
				output.writeInt(ICoreConstants.WORKSPACE_TREE_VERSION_2);
1275
				writeTree(project, output, monitor);
1276
			} finally {
1277
				output.close();
1278
			}
1279
			out = new ZipOutputStream(snapOut);
1280
			out.setLevel(Deflater.BEST_COMPRESSION);
1281
			ZipEntry e = new ZipEntry("resource-index.tree"); //$NON-NLS-1$
1282
			out.putNextEntry(e);
1283
			int read = 0;
1284
			byte[] buffer = new byte[4096];
1285
			InputStream in = new FileInputStream(tmpTree);
1286
			try {
1287
				while ((read = in.read(buffer)) >= 0) {
1288
					out.write(buffer, 0, read);
1289
				}
1290
				out.closeEntry();
1291
			} finally {
1292
				in.close();
1293
			}
1294
			out.close();
1295
		} catch (IOException e) {
1296
			throw new ResourceException(IResourceStatus.FAILED_WRITE_LOCAL, snapshotPath, Messages.resources_copyProblem, e);
1297
		} finally {
1298
			tmpTree.delete();
1299
		}
1300
	}
1301
	
1302
	/**
1165
	 * Writes the current state of the entire workspace tree to disk.
1303
	 * Writes the current state of the entire workspace tree to disk.
1166
	 * This is used during workspace save.  saveTree(Project)
1304
	 * This is used during workspace save.  saveTree(Project)
1167
	 * is used to save the state of an individual project.
1305
	 * is used to save the state of an individual project.
(-)src/org/eclipse/core/internal/utils/Messages.java (+1 lines)
Lines 247-252 Link Here
247
	public static String resources_pathNull;
247
	public static String resources_pathNull;
248
	public static String resources_projectDesc;
248
	public static String resources_projectDesc;
249
	public static String resources_projectDescSync;
249
	public static String resources_projectDescSync;
250
	public static String resources_projectMustNotBeOpen;
250
	public static String resources_projectPath;
251
	public static String resources_projectPath;
251
	public static String resources_pruningHistory;
252
	public static String resources_pruningHistory;
252
	public static String resources_reading;
253
	public static String resources_reading;
(-)src/org/eclipse/core/internal/utils/messages.properties (+2 lines)
Lines 9-14 Link Here
9
#     IBM Corporation - initial API and implementation
9
#     IBM Corporation - initial API and implementation
10
#     Serge Beauchamp (Freescale Semiconductor) - [252996] add resource filtering
10
#     Serge Beauchamp (Freescale Semiconductor) - [252996] add resource filtering
11
#     Serge Beauchamp (Freescale Semiconductor) - [229633] Group and Project Path Variable Support
11
#     Serge Beauchamp (Freescale Semiconductor) - [229633] Group and Project Path Variable Support
12
#     Francis Lynch (Wind River) - [301563] project refresh snapshots
12
###############################################################################
13
###############################################################################
13
### Resources plugin messages.
14
### Resources plugin messages.
14
15
Lines 243-248 Link Here
243
resources_pathNull = Paths must not be null.
244
resources_pathNull = Paths must not be null.
244
resources_projectDesc = Problems encountered while setting project description.
245
resources_projectDesc = Problems encountered while setting project description.
245
resources_projectDescSync = Could not set the project description for ''{0}'' because the project description file (.project) is out of sync with the file system.
246
resources_projectDescSync = Could not set the project description for ''{0}'' because the project description file (.project) is out of sync with the file system.
247
resources_projectMustNotBeOpen = Project must not be open.
246
resources_projectPath = Path for project must have only one segment.
248
resources_projectPath = Path for project must have only one segment.
247
resources_pruningHistory = Pruning history.
249
resources_pruningHistory = Pruning history.
248
resources_reading = Reading.
250
resources_reading = Reading.
(-)src/org/eclipse/core/resources/IProject.java (-8 / +72 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 *  Copyright (c) 2000, 2009 IBM Corporation and others.
2
 *  Copyright (c) 2000, 2010 IBM Corporation and others.
3
 *  All rights reserved. This program and the accompanying materials
3
 *  All rights reserved. This program and the accompanying materials
4
 *  are made available under the terms of the Eclipse Public License v1.0
4
 *  are made available under the terms of the Eclipse Public License v1.0
5
 *  which accompanies this distribution, and is available at
5
 *  which accompanies this distribution, and is available at
Lines 7-15 Link Here
7
 * 
7
 * 
8
 *  Contributors:
8
 *  Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Francis Lynch (Wind River) - added loadSnapshot/saveSnapshot
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.core.resources;
12
package org.eclipse.core.resources;
12
13
14
import java.net.URI;
15
13
import java.util.Map;
16
import java.util.Map;
14
import org.eclipse.core.runtime.*;
17
import org.eclipse.core.runtime.*;
15
import org.eclipse.core.runtime.content.IContentTypeMatcher;
18
import org.eclipse.core.runtime.content.IContentTypeMatcher;
Lines 42-47 Link Here
42
 */
45
 */
43
public interface IProject extends IContainer, IAdaptable {
46
public interface IProject extends IContainer, IAdaptable {
44
	/**
47
	/**
48
	 * Option constant (value 1) indicating that the snapshot to be
49
	 * loaded or saved contains refresh information.
50
	 * @see #loadSnapshot(int, URI, IProgressMonitor)
51
	 * @see #saveSnapshot(int, URI, IProgressMonitor)
52
	 * @since 3.6
53
	 */
54
	public static final int SNAPSHOT_TREE = 1;
55
56
	/**
45
	 * Invokes the <code>build</code> method of the specified builder 
57
	 * Invokes the <code>build</code> method of the specified builder 
46
	 * for this project. Does nothing if this project is closed.  If this project
58
	 * for this project. Does nothing if this project is closed.  If this project
47
	 * has multiple builders on its build spec matching the given name, only
59
	 * has multiple builders on its build spec matching the given name, only
Lines 569-574 Link Here
569
	public boolean isOpen();
581
	public boolean isOpen();
570
582
571
	/**
583
	/**
584
	 * Loads a snapshot of project meta-data from the given location URI.
585
	 * Must be called after the project has been created, but before it is
586
	 * opened. The options constant controls what kind of snapshot information
587
	 * to load. Valid option values include:<ul>
588
	 * <li>@link{IProject#SNAPSHOT_REFRESH} - snapshot refresh info
589
	 * </ul>
590
	 * 
591
	 * @param options kind of snapshot information to load
592
	 * @param snapshotLocation URI for the snapshot information
593
	 * @param monitor a progress monitor, or <code>null</code> if progress
594
	 *		reporting is not desired
595
	 * @exception CoreException if this method fails. Reasons include:
596
	 * <ul>
597
	 * <li> The snapshot information was not found at the specified URI.</li>
598
	  * </ul>
599
	 * @exception OperationCanceledException if the operation is canceled.
600
	 * @see #saveSnapshot(int, URI, IProgressMonitor) 
601
	 * @since 3.6
602
	 */
603
	public void loadSnapshot(int options, URI snapshotLocation,
604
			IProgressMonitor monitor) throws CoreException;
605
606
	/**
572
	 * Renames this project so that it is located at the name in 
607
	 * Renames this project so that it is located at the name in 
573
	 * the given description.  
608
	 * the given description.  
574
	 * <p>
609
	 * <p>
Lines 621-633 Link Here
621
	 * of its resources from information stored on disk.
656
	 * of its resources from information stored on disk.
622
	 * </p>
657
	 * </p>
623
	 * <p>
658
	 * <p>
624
	 * The <code>BACKGROUND_REFRESH</code> update flag controls how
659
	 * When a project is opened for the first time, initial information about the
625
	 * this method behaves when a project is opened for the first time on a location
660
	 * project's existing resources can be obtained in the following ways:
626
	 * that has existing resources on disk.  If this flag is specified, resources on disk
661
	 * <ul>
627
	 * will be added to the project in the background after this method returns.
662
	 * <li>If a {@link #loadSnapshot(int, URI, IProgressMonitor)} call has been made
628
	 * Child resources of the project may not be available until this background
663
	 * before the open, resources are restored from that file (a file written by
629
	 * refresh completes. If this flag is not specified, resources on disk are added 
664
	 * {@link #saveSnapshot(int, URI, IProgressMonitor)}).
630
	 * to the project in the foreground before this method returns.
665
	 * <li>When the {@link IResource#BACKGROUND_REFRESH} flag is specified,
666
	 * resources on disk will be added to the project in the background after
667
	 * this method returns. Child resources of the project may not be available
668
	 * until this background refresh completes.
669
	 * <li>Otherwise, resource information is obtained with a refresh operation in the
670
	 * foreground, before this method returns.
671
	 * </ul>
631
	 * </p>
672
	 * </p>
632
	 * This method changes resources; these changes will be reported
673
	 * This method changes resources; these changes will be reported
633
	 * in a subsequent resource change event that includes
674
	 * in a subsequent resource change event that includes
Lines 689-694 Link Here
689
	public void open(IProgressMonitor monitor) throws CoreException;
730
	public void open(IProgressMonitor monitor) throws CoreException;
690
731
691
	/**
732
	/**
733
	 * Writes a snapshot of project meta-data into the given location URI.
734
	 * The options constant controls what kind of snapshot information to
735
	 * write. Valid option values include:<ul>
736
	 * <li>@link{IProject#SNAPSHOT_REFRESH} - snapshot refresh info
737
	 * </ul>
738
	 * 
739
	 * @param options kind of snapshot information to save
740
	 * @param snapshotLocation URI for the snapshot information
741
	 * @param monitor a progress monitor, or <code>null</code> if progress
742
	 *		reporting is not desired
743
	 * @exception CoreException if this method fails. Reasons include:
744
	 * <ul>
745
	 * <li> The URI is not writable or an error occurs writing the data.</li>
746
	  * </ul>
747
	 * @exception OperationCanceledException if the operation is canceled. 
748
	 * @see #loadSnapshot(int, URI, IProgressMonitor) 
749
	 * @since 3.6
750
	 */
751
	public void saveSnapshot(int options, URI snapshotLocation,
752
			IProgressMonitor monitor) throws CoreException;
753
754
	/**
692
	 * Changes this project resource to match the given project
755
	 * Changes this project resource to match the given project
693
	 * description. This project should exist and be open.
756
	 * description. This project should exist and be open.
694
	 * <p>
757
	 * <p>
Lines 852-855 Link Here
852
	 * @since 3.6
915
	 * @since 3.6
853
	 */
916
	 */
854
	public IPathVariableManager getPathVariableManager();
917
	public IPathVariableManager getPathVariableManager();
918
855
}
919
}

Return to bug 301563