### Eclipse Workspace Patch 1.0 #P org.eclipse.core.resources Index: src/org/eclipse/core/internal/resources/LocalMetaArea.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/LocalMetaArea.java,v retrieving revision 1.42 diff -u -r1.42 LocalMetaArea.java --- src/org/eclipse/core/internal/resources/LocalMetaArea.java 4 Mar 2010 23:02:51 -0000 1.42 +++ src/org/eclipse/core/internal/resources/LocalMetaArea.java 4 Mar 2010 23:16:08 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,7 +7,6 @@ * * Contributors: * IBM Corporation - initial API and implementation - * Francis Lynch (Wind River) - [301563] Save and load tree snapshots *******************************************************************************/ package org.eclipse.core.internal.resources; Index: src/org/eclipse/core/internal/resources/Project.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Project.java,v retrieving revision 1.166 diff -u -r1.166 Project.java --- src/org/eclipse/core/internal/resources/Project.java 4 Mar 2010 23:02:51 -0000 1.166 +++ src/org/eclipse/core/internal/resources/Project.java 4 Mar 2010 23:16:09 -0000 @@ -9,7 +9,7 @@ * IBM Corporation - initial API and implementation * Serge Beauchamp (Freescale Semiconductor) - [229633] Project Path Variable Support * Anton Leherbauer (Wind River) - [198591] Allow Builder to specify scheduling rule - * Francis Lynch (Wind River) - [301563] Save and load tree snapshots + * Francis Lynch (Wind River) - [301563] Save and load refresh information snapshots *******************************************************************************/ package org.eclipse.core.internal.resources; @@ -837,7 +837,8 @@ // copy the snapshot from the URI into the project metadata IPath snapshotPath = workspace.getMetaArea().getRefreshLocationFor(this); IFileStore snapshotFileStore = EFS.getStore(org.eclipse.core.filesystem.URIUtil.toURI(snapshotPath)); - EFS.getStore(snapshotLocation).copy(snapshotFileStore, EFS.OVERWRITE, monitor); + snapshotFileStore.delete(EFS.NONE, monitor); + EFS.getStore(snapshotLocation).copy(snapshotFileStore, options, monitor); } } /* (non-Javadoc) @@ -1083,7 +1084,7 @@ this, snapshotLocation, sub); monitor.worked(Policy.opWork / 2); } catch (OperationCanceledException e) { - //workspace.getWorkManager().operationCanceled(); + workspace.getWorkManager().operationCanceled(); throw e; } } finally { @@ -1091,7 +1092,6 @@ } } } - /* (non-Javadoc) * @see IProject#setDescription(IProjectDescription, int, IProgressMonitor) */ Index: src/org/eclipse/core/internal/resources/SaveManager.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SaveManager.java,v retrieving revision 1.103 diff -u -r1.103 SaveManager.java --- src/org/eclipse/core/internal/resources/SaveManager.java 4 Mar 2010 23:02:51 -0000 1.103 +++ src/org/eclipse/core/internal/resources/SaveManager.java 4 Mar 2010 23:16:10 -0000 @@ -7,12 +7,10 @@ * * Contributors: * IBM Corporation - initial API and implementation - * Francis Lynch (Wind River) - [301563] Save and load tree snapshots + * Francis Lynch (Wind River) - add support for snapshot of project tree *******************************************************************************/ package org.eclipse.core.internal.resources; -import org.eclipse.core.runtime.OperationCanceledException; - import org.eclipse.core.filesystem.IFileStore; import org.eclipse.core.filesystem.EFS; @@ -1260,6 +1258,7 @@ IProgressMonitor monitor) throws CoreException { IFileStore store = EFS.getStore(snapshotLocation); IPath snapshotPath = new Path(snapshotLocation.getPath()); + OutputStream snapOut = store.openOutputStream(EFS.NONE, monitor); java.io.File tmpTree = null; try { tmpTree = java.io.File.createTempFile("tmp", ".tree"); //$NON-NLS-1$//$NON-NLS-2$ @@ -1277,7 +1276,6 @@ } finally { output.close(); } - OutputStream snapOut = store.openOutputStream(EFS.NONE, monitor); out = new ZipOutputStream(snapOut); out.setLevel(Deflater.BEST_COMPRESSION); ZipEntry e = new ZipEntry("resource-index.tree"); //$NON-NLS-1$ @@ -1293,13 +1291,11 @@ } finally { in.close(); } + out.close(); } catch (IOException e) { throw new ResourceException(IResourceStatus.FAILED_WRITE_LOCAL, snapshotPath, Messages.resources_copyProblem, e); } finally { - if (out!=null) { - try { out.close(); } catch (IOException e) { /*ignore*/ } - } - if (tmpTree!=null) tmpTree.delete(); + tmpTree.delete(); } } Index: src/org/eclipse/core/internal/utils/Messages.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.core.resources/src/org/eclipse/core/internal/utils/Messages.java,v retrieving revision 1.43 diff -u -r1.43 Messages.java --- src/org/eclipse/core/internal/utils/Messages.java 4 Mar 2010 23:02:51 -0000 1.43 +++ src/org/eclipse/core/internal/utils/Messages.java 4 Mar 2010 23:16:10 -0000 @@ -9,7 +9,6 @@ * IBM - Initial API and implementation * Serge Beauchamp (Freescale Semiconductor) - [252996] add resource filtering * Serge Beauchamp (Freescale Semiconductor) - [229633] Group and Project Path Variable Support - * Francis Lynch (Wind River) - [301563] Save and load tree snapshots *******************************************************************************/ package org.eclipse.core.internal.utils; Index: src/org/eclipse/core/internal/utils/messages.properties =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.core.resources/src/org/eclipse/core/internal/utils/messages.properties,v retrieving revision 1.141 diff -u -r1.141 messages.properties --- src/org/eclipse/core/internal/utils/messages.properties 4 Mar 2010 23:02:51 -0000 1.141 +++ src/org/eclipse/core/internal/utils/messages.properties 4 Mar 2010 23:16:10 -0000 @@ -9,7 +9,7 @@ # IBM Corporation - initial API and implementation # Serge Beauchamp (Freescale Semiconductor) - [252996] add resource filtering # Serge Beauchamp (Freescale Semiconductor) - [229633] Group and Project Path Variable Support -# Francis Lynch (Wind River) - [301563] Save and load tree snapshots +# Francis Lynch (Wind River) - [301563] project refresh snapshots ############################################################################### ### Resources plugin messages. Index: src/org/eclipse/core/resources/IProject.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.core.resources/src/org/eclipse/core/resources/IProject.java,v retrieving revision 1.48 diff -u -r1.48 IProject.java --- src/org/eclipse/core/resources/IProject.java 4 Mar 2010 23:02:52 -0000 1.48 +++ src/org/eclipse/core/resources/IProject.java 4 Mar 2010 23:16:10 -0000 @@ -7,7 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation - * Francis Lynch (Wind River) - [301563] Save and load tree snapshots + * Francis Lynch (Wind River) - added loadSnapshot/saveSnapshot *******************************************************************************/ package org.eclipse.core.resources; @@ -45,8 +45,8 @@ */ public interface IProject extends IContainer, IAdaptable { /** - * Option constant (value 1) indicating that a snapshot to be - * loaded or saved contains a resource tree (refresh information). + * Option constant (value 1) indicating that the snapshot to be + * loaded or saved contains refresh information. * @see #loadSnapshot(int, URI, IProgressMonitor) * @see #saveSnapshot(int, URI, IProgressMonitor) * @since 3.6 @@ -585,16 +585,16 @@ * Must be called after the project has been created, but before it is * opened. The options constant controls what kind of snapshot information * to load. Valid option values include: * * @param options kind of snapshot information to load - * @param snapshotLocation URI to load from + * @param snapshotLocation URI for the snapshot information * @param monitor a progress monitor, or null if progress * reporting is not desired * @exception CoreException if this method fails. Reasons include: * * @exception OperationCanceledException if the operation is canceled. * @see #saveSnapshot(int, URI, IProgressMonitor) @@ -661,10 +661,8 @@ *