Mounting work in progress
diff --git a/bundles/org.eclipse.core.resources/.project b/bundles/org.eclipse.core.resources/.project
index 26047c9..fb58441 100644
--- a/bundles/org.eclipse.core.resources/.project
+++ b/bundles/org.eclipse.core.resources/.project
@@ -14,39 +14,6 @@
<arguments>
</arguments>
</buildCommand>
- <buildCommand>
- <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
- <arguments>
- <dictionary>
- <key>!{tool_args}</key>
- <value>-DbuildType=${build_type}</value>
- </dictionary>
- <dictionary>
- <key>!{tool_loc}</key>
- <value>${workspace_loc:/org.eclipse.core.resources/scripts/buildExtraJAR.xml}</value>
- </dictionary>
- <dictionary>
- <key>!{tool_dir}</key>
- <value></value>
- </dictionary>
- <dictionary>
- <key>!{tool_refresh}</key>
- <value>${none}</value>
- </dictionary>
- <dictionary>
- <key>!{tool_name}</key>
- <value>org.eclipse.core.resources extra builder</value>
- </dictionary>
- <dictionary>
- <key>!{tool_type}</key>
- <value>org.eclipse.ui.externaltools.type.ant</value>
- </dictionary>
- <dictionary>
- <key>!{tool_show_log}</key>
- <value>true</value>
- </dictionary>
- </arguments>
- </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
diff --git a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/FileSystemResourceManager.java b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/FileSystemResourceManager.java
index 3ccc741..7177ae9 100644
--- a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/FileSystemResourceManager.java
+++ b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/FileSystemResourceManager.java
@@ -239,6 +239,8 @@
}
}
public IPath locationFor(IResource target) {
+ //note: this method is a critical performance path,
+ //code may be inlined to prevent method calls
switch (target.getType()) {
case IResource.ROOT :
return Platform.getLocation();
@@ -250,7 +252,22 @@
}
return getProjectDefaultLocation(project);
default:
- //first get the location of the project (without the project name)
+ //check if the resource is mounted
+ IPath targetPath = target.getFullPath();
+ int numSegments = targetPath.segmentCount();
+ IResource mounted = target;
+ if (numSegments > 2) {
+ //parent could be a mounted resource
+ mounted = workspace.getRoot().getFolder(
+ targetPath.removeLastSegments(numSegments-2));
+ }
+ ResourceInfo mountedInfo = ((Resource)mounted).getResourceInfo(true, false);
+ if (mountedInfo != null && mountedInfo.isSet(M_MOUNTED)) {
+ String location = (String)mountedInfo.getSessionProperty(K_MOUNT_LOCATION);
+ return new Path(location).append(targetPath.removeFirstSegments(2));
+ }
+
+ //not a mounted resource -- get location of project
description = ((Project)target.getProject()).internalGetDescription();
if (description != null && description.getLocation() != null) {
return description.getLocation().append(target.getProjectRelativePath());
@@ -259,6 +276,13 @@
}
}
}
+public void mount(Folder target, IPath localLocation) {
+ //resource already exists when mounting -- just need to update sync info
+ long lastModified = CoreFileSystemLibrary.getLastModified(localLocation.toFile().getAbsolutePath());
+ ResourceInfo info = ((Resource) target).getResourceInfo(false, true);
+ updateLocalSync(info, lastModified, false);
+}
+
public void move(IResource target, IPath destination, boolean keepHistory, IProgressMonitor monitor) throws CoreException {
monitor = Policy.monitorFor(monitor);
try {
diff --git a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/UnifiedTree.java b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/UnifiedTree.java
index 2945d18..afa4f92 100644
--- a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/UnifiedTree.java
+++ b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/UnifiedTree.java
@@ -80,59 +80,72 @@
IResource parent = node.getResource();
/* is there a possibility to have children? */
- if (parent.getType() == IResource.FILE && node.isFile())
+ int parentType = parent.getType();
+ if (parentType == IResource.FILE && node.isFile())
return;
/* get the list of resources in the file system */
String parentLocalLocation = node.getLocalLocation();
Object[] list = getLocalList(node, parentLocalLocation);
- int index = 0;
+ int localIndex = 0;
/* get the list of resources in the workspace */
- if (node.existsInWorkspace() && (parent.getType() == IResource.FOLDER || parent.getType() == IResource.PROJECT)) {
+ if (node.existsInWorkspace() && (parentType == IResource.FOLDER || parentType == IResource.PROJECT)) {
IResource target = null;
- boolean next = true;
UnifiedTreeNode child = null;
IResource[] members = ((IContainer) parent).members(IContainer.INCLUDE_TEAM_PRIVATE_MEMBERS);
- int i = 0;
- while (true) {
- if (next) {
- if (i >= members.length)
- break;
- target = members[i++];
- }
+ int workspaceIndex = 0;
+ //iterate simultaneously over file system and workspace members
+ while (workspaceIndex < members.length) {
+ target = members[workspaceIndex];
String name = target.getName();
- String localName = (list != null && index < list.length) ? (String) list[index] : null;
+ String localName = (list != null && localIndex < list.length) ? (String) list[localIndex] : null;
int comp = localName != null ? name.compareTo(localName) : -1;
- if (comp == 0) {
+ //special handling for mounted resources
+ if (parentType == IResource.PROJECT && target.isMounted()) {
+ child = createChildForMountedResource(target);
+ workspaceIndex++;
+ //if there is a matching local file, skip it - it will be blocked by the mounted resource
+ if (comp == 0)
+ localIndex++;
+ } else if (comp == 0) {
// resource exists in workspace and file system
String localLocation = createChildLocation(parentLocalLocation, localName);
long stat = CoreFileSystemLibrary.getStat(localLocation);
child = createNode(target, stat, localLocation, localName, true);
- index++;
- next = true;
+ localIndex++;
+ workspaceIndex++;
} else
if (comp > 0) {
// resource exists only in file system
child = createChildNodeFromFileSystem(node, parentLocalLocation, localName);
- index++;
- next = false;
+ localIndex++;
} else {
// resource exists only in the workspace
child = createNode(target, 0, null, null, true);
- next = true;
+ workspaceIndex++;
}
addChildToTree(node, child);
}
}
/* process any remaining resource from the file system */
- addChildrenFromFileSystem(node, parentLocalLocation, list, index);
+ addChildrenFromFileSystem(node, parentLocalLocation, list, localIndex);
/* if we added children, add the childMarker separator */
if (node.getFirstChild() != null)
addChildrenMarker();
}
+/**
+ * Creates a tree node for a resource that is mounted in a different file system location.
+ */
+protected UnifiedTreeNode createChildForMountedResource(IResource target) {
+ IPath location = target.getLocation();
+ String locationString = location.toOSString();
+ String localName = location.lastSegment();
+ long stat = CoreFileSystemLibrary.getStat(locationString);
+ return new UnifiedTreeNode(this, target, stat, locationString, localName, true);
+}
protected void addChildrenFromFileSystem(UnifiedTreeNode node, String parentLocalLocation, Object[] list, int index) throws CoreException {
if (list == null)
return;
diff --git a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Folder.java b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Folder.java
index 7404193..1ccc22a 100644
--- a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Folder.java
+++ b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Folder.java
@@ -10,12 +10,10 @@
******************************************************************************/
package org.eclipse.core.internal.resources;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.internal.localstore.CoreFileSystemLibrary;
import org.eclipse.core.internal.utils.Policy;
+import org.eclipse.core.resources.*;
+import org.eclipse.core.runtime.*;
public class Folder extends Container implements IFolder {
protected Folder(IPath path, Workspace container) {
@@ -159,4 +157,63 @@
}
}
+/**
+ * @see org.eclipse.core.resources.IFolder#mount(IPath, int, IProgressMonitor)
+ */
+public void mount(IPath localLocation, int updateFlags, IProgressMonitor monitor) throws CoreException {
+ monitor = Policy.monitorFor(monitor);
+ try {
+ String message = Policy.bind("resources.mounting", getFullPath().toString()); //$NON-NLS-1$
+ monitor.beginTask(message, Policy.totalWork);
+ checkValidPath(path, FOLDER);
+ try {
+ workspace.prepareOperation();
+ assertMountRequirements(localLocation);
+ workspace.beginOperation(true);
+ ResourceInfo info = workspace.createResource(this, false);
+ info.setSessionProperty(K_MOUNT_LOCATION, localLocation.toString());
+ info.set(M_MOUNTED);
+ getLocalManager().mount(this, localLocation);
+ monitor.worked(Policy.opWork * 10 / 100);
+ refreshLocal(DEPTH_INFINITE, Policy.subMonitorFor(monitor, Policy.opWork * 90 / 100));
+ } catch (OperationCanceledException e) {
+ workspace.getWorkManager().operationCanceled();
+ throw e;
+ } finally {
+ workspace.endOperation(true, Policy.subMonitorFor(monitor, Policy.buildWork));
+ }
+ } finally {
+ monitor.done();
+ }
+}
+
+/**
+ * @see org.eclipse.core.resources.IFolder#unmount(int, IProgressMonitor)
+ */
+public void unmount(int updateFlags, IProgressMonitor monitor) throws CoreException {
+ monitor = Policy.monitorFor(monitor);
+ try {
+ String message = Policy.bind("resources.unmounting", getFullPath().toString()); //$NON-NLS-1$
+ monitor.beginTask(message, Policy.totalWork);
+ try {
+ workspace.prepareOperation();
+ ResourceInfo info = getResourceInfo(true, false);
+ checkExists(getFlags(info), true);
+ //check if mounted
+ if (!info.isSet(M_MOUNTED)) {
+ String msg = Policy.bind("resources.notMounted", getFullPath().toString());//$NON-NLS-1$
+ throw new ResourceException(IResourceStatus.RESOURCE_NOT_MOUNTED, getFullPath(), msg, null);
+ }
+ workspace.beginOperation(true);
+ deleteResource(true, null);
+ } catch (OperationCanceledException e) {
+ workspace.getWorkManager().operationCanceled();
+ throw e;
+ } finally {
+ workspace.endOperation(true, Policy.subMonitorFor(monitor, Policy.buildWork));
+ }
+ } finally {
+ monitor.done();
+ }
+}
}
diff --git a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/ICoreConstants.java b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/ICoreConstants.java
index c64d337..c6a040c 100644
--- a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/ICoreConstants.java
+++ b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/ICoreConstants.java
@@ -15,9 +15,11 @@
public interface ICoreConstants {
- // Standard resource SessionProperties
+ // Standard resource properties
/** map of builders to their last built state. */
public static final QualifiedName K_BUILD_MAP = new QualifiedName(ResourcesPlugin.PI_RESOURCES, "BuildMap"); //$NON-NLS-1$
+ /** local file system location for mounted resources */
+ public static final QualifiedName K_MOUNT_LOCATION = new QualifiedName(ResourcesPlugin.PI_RESOURCES, "MountLocation"); //$NON-NLS-1$
// resource info constants
static final long I_UNKNOWN_SYNC_INFO = -2;
@@ -43,6 +45,11 @@
* @since 2.0
*/
static final int M_TEAM_PRIVATE_MEMBER = 0x8000;
+ /**
+ * Marks this resource as a mounted resource.
+ * @since 2.1
+ */
+ static final int M_MOUNTED = 0x10000;
static final int NULL_FLAG = -1;
// Internal status codes
diff --git a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Resource.java b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Resource.java
index 9f8a21e..c24c5e3 100644
--- a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Resource.java
+++ b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Resource.java
@@ -12,6 +12,7 @@
import java.net.MalformedURLException;
import java.net.URL;
+
import org.eclipse.core.internal.localstore.*;
import org.eclipse.core.internal.properties.PropertyManager;
import org.eclipse.core.internal.utils.Assert;
@@ -78,6 +79,27 @@
Assert.isTrue(false, status.getChildren()[0].getMessage());
}
}
+protected void assertMountRequirements(IPath localLocation) throws CoreException {
+ checkDoesNotExist(getFlags(getResourceInfo(false, false)), true);
+ Container parent = (Container) getParent();
+ if (parent == null || parent.getType() != IResource.PROJECT) {
+ String msg = Policy.bind("resources.mountNonProject", getFullPath().toString());//$NON-NLS-1$
+ Assert.isLegal(false, msg);
+ }
+ parent.checkAccessible(getFlags(parent.getResourceInfo(false, false)));
+ java.io.File localFile = localLocation.toFile();
+ if (!localFile.exists()) {
+ String msg = Policy.bind("resources.mountDoesNotExist", getFullPath().toString());//$NON-NLS-1$
+ throw new ResourceException(IResourceStatus.NOT_FOUND_LOCAL, getFullPath(), msg, null);
+ }
+ //resource type and file system type must match
+ if ((getType() == IResource.FOLDER) != localFile.isDirectory()) {
+ String msg = Policy.bind("resources.mountWrongType", getFullPath().toString());//$NON-NLS-1$
+ throw new ResourceException(IResourceStatus.WRONG_TYPE_LOCAL, getFullPath(), msg, null);
+ }
+ //TODO:The corresponding location in the local file system is already
+ //associated with a resource in this workspace.</li>
+}
protected void assertMoveRequirements(IPath destination, int destinationType) throws CoreException {
IStatus status = checkMoveRequirements(destination, destinationType);
if (!status.isOK()) {
@@ -764,6 +786,13 @@
return flags != NULL_FLAG && ResourceInfo.isSet(flags, M_LOCAL_EXISTS);
}
/**
+ * @see org.eclipse.core.resources.IResource#isMounted()
+ */
+public boolean isMounted() {
+ ResourceInfo info = getResourceInfo(false, false);
+ return info != null && info.isSet(M_MOUNTED);
+}
+/**
* @see IResource
*/
public boolean isPhantom() {
@@ -1185,7 +1214,4 @@
}
}
}
-
-
-
}
\ No newline at end of file
diff --git a/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IFile.java b/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IFile.java
index beb92a0..6d43bf8 100644
--- a/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IFile.java
+++ b/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IFile.java
@@ -437,6 +437,54 @@
public boolean isReadOnly();
/**
+ * Creates a new file resource as a member of this handle's parent resource.
+ * The file's contents will be located in the file specified by the given
+ * file system path. This resource must not already exist; the file
+ * specified by the given local location must already exist. This handle's parent
+ * resource must be a project.
+ * <p>
+ * There are currently no update flags applicable for this operation.
+ * </p>
+ * <p>
+ * This method synchronizes this resource with the local file system at the given
+ * location.
+ * </p>
+ * <p>
+ * This method changes resources; these changes will be reported
+ * in a subsequent resource change event, including an indication
+ * that the folder has been added to its parent.
+ * </p>
+ * <p>
+ * This method is long-running; progress and cancellation are provided
+ * by the given progress monitor.
+ * </p>
+ *
+ * @param updateFlags bit-wise or of update flag constants
+ * (none are currently applicable)
+ * @param localLocation a file system path where the file should be mounted
+ * @param monitor a progress monitor, or <code>null</code> if progress
+ * reporting and cancellation are not desired
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li> This resource already exists in the workspace.</li>
+ * <li> The workspace contains a resource of a different type
+ * at the same path as this resource.</li>
+ * <li> The parent of this resource does not exist.</li>
+ * <li> The parent of this resource is a closed project.</li>
+ * <li> The name of this resource is not valid (according to
+ * <code>IWorkspace.validateName</code>).</li>
+ * <li> The corresponding location in the local file system is occupied
+ * by a directory (as opposed to a file).</li>
+ * <li> The corresponding location in the local file system is already
+ * associated with a resource in this workspace.</li>
+ * <li> Resource changes are disallowed during certain types of resource change
+ * event notification. See IResourceChangeEvent for more details.</li>
+ * </ul>
+ * @see #unmount
+ * @since 2.1
+ */
+public void mount(IPath localLocation, int updateFlags, IProgressMonitor monitor) throws CoreException;
+/**
* Moves this resource to be at the given location.
* <p>
* This is a convenience method, fully equivalent to:
@@ -631,6 +679,42 @@
* @since 2.0
*/
public void setContents(InputStream source, int updateFlags, IProgressMonitor monitor) throws CoreException;
+/**
+ * Removes this mounted file from the workspace, but leaves the
+ * contents in the file system intact. This operation is only allowed
+ * on files that have been mounted with the <code>mount</code>
+ * method.
+ * <p>
+ * Unmounting a resource also deletes its session and persistent
+ * properties and markers.
+ * </p>
+ * <p>
+ * Unmounting a resource which has sync information converts the resource
+ * to a phantom and retains the sync information for future use.
+ * </p>
+ * <p>
+ * This method changes resources; these changes will be reported
+ * in a subsequent resource change event.
+ * </p>
+ * <p>
+ * This method is long-running; progress and cancellation are provided
+ * by the given progress monitor.
+ * </p>
+ *
+ * @param updateFlags bit-wise or of update flag constants
+ * (none are currently applicable)
+ * @param monitor a progress monitor, or <code>null</code> if progress
+ * reporting and cancellation are not desired
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li> This resource does not exist.</li>
+ * <li> Resource changes are disallowed during certain types of resource change
+ * event notification. See IResourceChangeEvent for more details.</li>
+ * </ul>
+ * @see #mount
+ * @since 2.1
+ */
+public void unmount(int updateFlags, IProgressMonitor monitor) throws CoreException;
/**
* Sets the contents of this file to the bytes in the given file state.
diff --git a/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IFolder.java b/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IFolder.java
index 2999ec3..0df5caa 100644
--- a/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IFolder.java
+++ b/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IFolder.java
@@ -200,6 +200,53 @@
* @see #getFile
*/
public IFolder getFolder(String name);
+/**
+ * Creates a new folder resource as a member of this handle's parent resource.
+ * The folder's contents will be located in the directory specified by the given
+ * file system path.
+ * <p>
+ * There are currently no update flags applicable for this operation.
+ * </p>
+ * <p>
+ * This method synchronizes this resource with the local file system at the given
+ * location.
+ * </p>
+ * <p>
+ * This method changes resources; these changes will be reported
+ * in a subsequent resource change event, including an indication
+ * that the folder has been added to its parent.
+ * </p>
+ * <p>
+ * This method is long-running; progress and cancellation are provided
+ * by the given progress monitor.
+ * </p>
+ *
+ * @param updateFlags bit-wise or of update flag constants
+ * (none are currently applicable)
+ * @param localLocation a file system path where the folder should be mounted
+ * @param monitor a progress monitor, or <code>null</code> if progress
+ * reporting and cancellation are not desired
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li> This resource already exists in the workspace.</li>
+ * <li> The workspace contains a resource of a different type
+ * at the same path as this resource.</li>
+ * <li> The parent of this resource does not exist.</li>
+ * <li> The parent of this resource is not an open project</li>
+ * <li> The name of this resource is not valid (according to
+ * <code>IWorkspace.validateName</code>).</li>
+ * <li> The corresponding location in the local file system does not exist.</li>
+ * <li> The corresponding location in the local file system is occupied
+ * by a file (as opposed to a directory).</li>
+ * <li> The corresponding location in the local file system is already
+ * associated with a resource in this workspace.</li>
+ * <li> Resource changes are disallowed during certain types of resource change
+ * event notification. See IResourceChangeEvent for more details.</li>
+ * </ul>
+ * @see #unmount
+ * @since 2.1
+ */
+public void mount(IPath localLocation, int updateFlags, IProgressMonitor monitor) throws CoreException;
/**
* Moves this resource so that it is located at the given path.
@@ -247,4 +294,42 @@
* @see IResource#move(IPath,int,IProgressMonitor)
*/
public void move(IPath destination, boolean force, boolean keepHistory, IProgressMonitor monitor) throws CoreException;
+/**
+ * Removes this mounted folder from the workspace, but leaves the
+ * contents in the file system intact. This operation is only allowed
+ * on folders that have been mounted with the <code>mount</code>
+ * method.
+ * <p>
+ * Unmounting a resource also deletes its session and persistent
+ * properties and markers.
+ * </p>
+ * <p>
+ * Unmounting a resource which has sync information converts the resource
+ * to a phantom and retains the sync information for future use.
+ * </p>
+ * <p>
+ * This method changes resources; these changes will be reported
+ * in a subsequent resource change event.
+ * </p>
+ * <p>
+ * This method is long-running; progress and cancellation are provided
+ * by the given progress monitor.
+ * </p>
+ *
+ * @param updateFlags bit-wise or of update flag constants
+ * (none are currently applicable)
+ * @param monitor a progress monitor, or <code>null</code> if progress
+ * reporting and cancellation are not desired
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li> This resource does not exist.</li>
+ * <li> Resource changes are disallowed during certain types of resource change
+ * event notification. See IResourceChangeEvent for more details.</li>
+ * <li> This resource is not a mounted folder.</li>
+ * </ul>
+ * @see #mount
+ * @see IResource#isMounted
+ * @since 2.1
+ */
+public void unmount(int updateFlags, IProgressMonitor monitor) throws CoreException;
}
diff --git a/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IResource.java b/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IResource.java
index ce2ec72..dd26f45 100644
--- a/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IResource.java
+++ b/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IResource.java
@@ -329,46 +329,6 @@
* reporting and cancellation are not desired
*/
public void clearHistory(IProgressMonitor monitor) throws CoreException;
-
-/**
- * Makes a copy of this project using the given project description.
- * <p>
- * This is a convenience method, fully equivalent to:
- * <pre>
- * copy(description, (force ? FORCE : IResource.NONE), monitor);
- * </pre>
- * </p>
- * <p>
- * This operation changes resources; these changes will be reported
- * in a subsequent resource change event that will include
- * an indication that the resource copy has been added to its new parent.
- * </p>
- * <p>
- * This operation is long-running; progress and cancellation are provided
- * by the given progress monitor.
- * </p>
- *
- * @param description the destination project description
- * @param force a flag controlling whether resources that are not
- * in sync with the local file system will be tolerated
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @exception CoreException if this resource could not be copied. Reasons include:
- * <ul>
- * <li> This resource does not exist.</li>
- * <li> This resource or one of its descendents is not local.</li>
- * <li> This resource is not a project.</li>
- * <li> The project described by the given description already exists.</li>
- * <li> This resource or one of its descendents is out of sync with the local file
- * system and <code>force</code> is <code>false</code>.</li>
- * <li> The workspace and the local file system are out of sync
- * at the destination resource or one of its descendents.</li>
- * <li> Resource changes are disallowed during certain types of resource change
- * event notification. See IResourceChangeEvent for more details.</li>
- * </ul>
- */
-public void copy(IProjectDescription description, boolean force, IProgressMonitor monitor) throws CoreException;
-
/**
* Makes a copy of this resource at the given path.
* <p>
@@ -412,69 +372,6 @@
* </ul>
*/
public void copy(IPath destination, boolean force, IProgressMonitor monitor) throws CoreException;
-
-/**
- * Makes a copy of this project using the given project description.
- * The project's descendents are copied as well. The description
- * specifies the name, location and attributes of the new project.
- * After successful completion, corresponding new resources will exist
- * at the given path; their contents and properties will be copies of
- * the originals. The original resources are not affected.
- * <p>
- * When a resource is copied, its persistent properties are
- * copied with it. Session properties and markers are not copied.
- * </p>
- * <p>
- * The <code>FORCE</code> update flag controls how this method deals with
- * cases where the workspace is not completely in sync with the local file
- * system. If <code>FORCE</code> is not specified, the method will only attempt
- * to copy resources that are in sync with the corresponding files and
- * directories in the local file system; it will fail if it
- * encounters a resource that is out of sync with the file system.
- * However, if <code>FORCE</code> is specified, the method
- * copies all corresponding files and directories from the local
- * file system, including ones that have been recently updated or created.
- * Note that in both settings of the <code>FORCE</code> flag,
- * the operation fails if the newly created resources in the
- * workspace would be out of sync with the local file system;
- * this ensures files in the file system cannot be accidentally
- * overwritten.
- * </p>
- * <p>
- * Update flags other than <code>FORCE</code> are ignored.
- * </p>
- * <p>
- * This operation changes resources; these changes will be reported
- * in a subsequent resource change event that will include
- * an indication that the resource copy has been added to its new parent.
- * </p>
- * <p>
- * This operation is long-running; progress and cancellation are provided
- * by the given progress monitor.
- * </p>
- *
- * @param description the destination project description
- * @param updateFlags bit-wise or of update flag constants
- * (only <code>FORCE</code> is relevant here)
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @exception CoreException if this resource could not be copied. Reasons include:
- * <ul>
- * <li> This resource does not exist.</li>
- * <li> This resource or one of its descendents is not local.</li>
- * <li> This resource is not a project.</li>
- * <li> The project described by the given description already exists.</li>
- * <li> This resource or one of its descendents is out of sync with the local file
- * system and <code>FORCE</code> is not specified.</li>
- * <li> The workspace and the local file system are out of sync
- * at the destination resource or one of its descendents.</li>
- * <li> Resource changes are disallowed during certain types of resource change
- * event notification. See IResourceChangeEvent for more details.</li>
- * </ul>
- * @since 2.0
- */
-public void copy(IProjectDescription description, int updateFlags, IProgressMonitor monitor) throws CoreException;
-
/**
* Makes a copy of this resource at the given path. The resource's
* descendents are copied as well.
@@ -557,6 +454,113 @@
* @since 2.0
*/
public void copy(IPath destination, int updateFlags, IProgressMonitor monitor) throws CoreException;
+/**
+ * Makes a copy of this project using the given project description.
+ * <p>
+ * This is a convenience method, fully equivalent to:
+ * <pre>
+ * copy(description, (force ? FORCE : IResource.NONE), monitor);
+ * </pre>
+ * </p>
+ * <p>
+ * This operation changes resources; these changes will be reported
+ * in a subsequent resource change event that will include
+ * an indication that the resource copy has been added to its new parent.
+ * </p>
+ * <p>
+ * This operation is long-running; progress and cancellation are provided
+ * by the given progress monitor.
+ * </p>
+ *
+ * @param description the destination project description
+ * @param force a flag controlling whether resources that are not
+ * in sync with the local file system will be tolerated
+ * @param monitor a progress monitor, or <code>null</code> if progress
+ * reporting and cancellation are not desired
+ * @exception CoreException if this resource could not be copied. Reasons include:
+ * <ul>
+ * <li> This resource does not exist.</li>
+ * <li> This resource or one of its descendents is not local.</li>
+ * <li> This resource is not a project.</li>
+ * <li> The project described by the given description already exists.</li>
+ * <li> This resource or one of its descendents is out of sync with the local file
+ * system and <code>force</code> is <code>false</code>.</li>
+ * <li> The workspace and the local file system are out of sync
+ * at the destination resource or one of its descendents.</li>
+ * <li> Resource changes are disallowed during certain types of resource change
+ * event notification. See IResourceChangeEvent for more details.</li>
+ * </ul>
+ */
+public void copy(IProjectDescription description, boolean force, IProgressMonitor monitor) throws CoreException;
+
+
+
+
+
+
+/**
+ * Makes a copy of this project using the given project description.
+ * The project's descendents are copied as well. The description
+ * specifies the name, location and attributes of the new project.
+ * After successful completion, corresponding new resources will exist
+ * at the given path; their contents and properties will be copies of
+ * the originals. The original resources are not affected.
+ * <p>
+ * When a resource is copied, its persistent properties are
+ * copied with it. Session properties and markers are not copied.
+ * </p>
+ * <p>
+ * The <code>FORCE</code> update flag controls how this method deals with
+ * cases where the workspace is not completely in sync with the local file
+ * system. If <code>FORCE</code> is not specified, the method will only attempt
+ * to copy resources that are in sync with the corresponding files and
+ * directories in the local file system; it will fail if it
+ * encounters a resource that is out of sync with the file system.
+ * However, if <code>FORCE</code> is specified, the method
+ * copies all corresponding files and directories from the local
+ * file system, including ones that have been recently updated or created.
+ * Note that in both settings of the <code>FORCE</code> flag,
+ * the operation fails if the newly created resources in the
+ * workspace would be out of sync with the local file system;
+ * this ensures files in the file system cannot be accidentally
+ * overwritten.
+ * </p>
+ * <p>
+ * Update flags other than <code>FORCE</code> are ignored.
+ * </p>
+ * <p>
+ * This operation changes resources; these changes will be reported
+ * in a subsequent resource change event that will include
+ * an indication that the resource copy has been added to its new parent.
+ * </p>
+ * <p>
+ * This operation is long-running; progress and cancellation are provided
+ * by the given progress monitor.
+ * </p>
+ *
+ * @param description the destination project description
+ * @param updateFlags bit-wise or of update flag constants
+ * (only <code>FORCE</code> is relevant here)
+ * @param monitor a progress monitor, or <code>null</code> if progress
+ * reporting and cancellation are not desired
+ * @exception CoreException if this resource could not be copied. Reasons include:
+ * <ul>
+ * <li> This resource does not exist.</li>
+ * <li> This resource or one of its descendents is not local.</li>
+ * <li> This resource is not a project.</li>
+ * <li> The project described by the given description already exists.</li>
+ * <li> This resource or one of its descendents is out of sync with the local file
+ * system and <code>FORCE</code> is not specified.</li>
+ * <li> The workspace and the local file system are out of sync
+ * at the destination resource or one of its descendents.</li>
+ * <li> Resource changes are disallowed during certain types of resource change
+ * event notification. See IResourceChangeEvent for more details.</li>
+ * </ul>
+ * @since 2.0
+ */
+public void copy(IProjectDescription description, int updateFlags, IProgressMonitor monitor) throws CoreException;
+
+
/**
* Creates and returns the marker with the specified type on this resource.
@@ -1101,6 +1105,16 @@
*/
public boolean isAccessible();
/**
+ * Returns whether this resource subtree is marked as derived. Returns
+ * <code>false</code> if this resource does not exist.
+ *
+ * @return <code>true</code> if this resource is marked as derived, and
+ * <code>false</code> otherwise
+ * @see #setDerived
+ * @since 2.0
+ */
+public boolean isDerived();
+/**
* Returns whether this resource and its members (to the
* specified depth) are expected to have their contents (and properties)
* available locally. Returns <code>false</code> in all other cases,
@@ -1120,6 +1134,19 @@
*/
public boolean isLocal(int depth);
/**
+ * Returns <code>true</code> if this resource has been mounted
+ * in a location outside of the project's content area. Returns <code>false</code>
+ * in all other cases, including the case where this resource does not exist.
+ * The workspace root and projects are never mounted.
+ *
+ * @return <code>true</code> if this resource is mounted, and
+ * <code>false</code> otherwise
+ *
+ * @see IFile#mount
+ * @see IFolder#mount
+ */
+public boolean isMounted();
+/**
* Returns whether this resource is a phantom resource.
* <p>
* The workspace uses phantom resources to remember outgoing deletions and
@@ -1186,54 +1213,16 @@
* @since 2.0
*/
public boolean isSynchronized(int depth);
-
-
/**
- * Renames or relocates this project so that it is the project specified by the given project
- * description.
- * <p>
- * This is a convenience method, fully equivalent to:
- * <pre>
- * move(description, (keepHistory ? KEEP_HISTORY : IResource.NONE) | (force ? FORCE : IResource.NONE), monitor);
- * </pre>
- * </p>
- * <p>
- * This operation changes resources; these changes will be reported
- * in a subsequent resource change event that will include
- * an indication that the resource has been removed from its parent
- * and that a corresponding resource has been added to its new parent.
- * Additional information provided with resource delta shows that these
- * additions and removals are related.
- * </p>
- * <p>
- * This method is long-running; progress and cancellation are provided
- * by the given progress monitor.
- * </p>
+ * Returns whether this resource is a team private member of its parent container.
+ * Returns <code>false</code> if this resource does not exist.
*
- * @param description the destination project description
- * @param force a flag controlling whether resources that are not
- * in sync with the local file system will be tolerated
- * @param keepHistory a flag indicating whether or not to keep
- * local history for files
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @exception CoreException if this resource could not be moved. Reasons include:
- * <ul>
- * <li> This resource does not exist.</li>
- * <li> This resource or one of its descendents is not local.</li>
- * <li> This resource is not a project.</li>
- * <li> The project at the destination already exists.</li>
- * <li> This resource or one of its descendents is out of sync with the local file
- * system and <code>force</code> is <code>false</code>.</li>
- * <li> The workspace and the local file system are out of sync
- * at the destination resource or one of its descendents.</li>
- * <li> Resource changes are disallowed during certain types of resource change
- * event notification. See IResourceChangeEvent for more details.</li>
- * </ul>
- * @see IResourceDelta#getFlags
+ * @return <code>true</code> if this resource is a team private member, and
+ * <code>false</code> otherwise
+ * @see #setTeamPrivateMember
+ * @since 2.0
*/
-public void move(IProjectDescription description, boolean force, boolean keepHistory, IProgressMonitor monitor) throws CoreException;
-
+public boolean isTeamPrivateMember();
/**
* Moves this resource so that it is located at the given path.
* <p>
@@ -1283,99 +1272,6 @@
* @see IResourceDelta#getFlags
*/
public void move(IPath destination, boolean force, IProgressMonitor monitor) throws CoreException;
-
-/**
- * Renames or relocates this project so that it is the project specified by the given
- * project description. The description specifies the name, location and attributes
- * of the new project. After successful completion, the old project and
- * any direct or indirect members will no longer exist; but corresponding
- * new resources will now exist at the project.
- * <p>
- * When a resource moves, its session and persistent properties move
- * with it. Likewise for all the other attributes of the resource including
- * markers.
- * </p>
- * <p>
- * When this project's location is the default location, then the directories
- * and files on disk are moved to be in
- * the location specified by the given description. If the given description
- * specifies the default location for the project, the directories and files
- * are moved to the default location. In all other cases the directories and
- * files on disk are left untouched. If the name in the given description is
- * the same as this project's name and the location is different, then the
- * project contents will be moved to the new location. All other parts of the
- * given description are ignored.
- * </p>
- * <p>
- * The <code>FORCE</code> update flag controls how this method deals with
- * cases where the workspace is not completely in sync with the local file
- * system. If <code>FORCE</code> is not specified, the method will only attempt
- * to move resources that are in sync with the corresponding files and
- * directories in the local file system; it will fail if it
- * encounters a resource that is out of sync with the file system.
- * However, if <code>FORCE</code> is specified, the method
- * moves all corresponding files and directories from the local
- * file system, including ones that have been recently updated or created.
- * Note that in both settings of the <code>FORCE</code> flag,
- * the operation fails if the newly created resources in the
- * workspace would be out of sync with the local file system;
- * this ensures files in the file system cannot be accidentally
- * overwritten.
- * </p>
- * <p>
- * The <code>KEEP_HISTORY</code> update flag controls whether or not
- * file that are about to be deleted from the local file system have their
- * current contents saved in the workspace's local history. The local history
- * mechanism serves as a safety net to help the user recover from mistakes that
- * might otherwise result in data loss. Specifying <code>KEEP_HISTORY</code>
- * is recommended except in circumstances where past states of the files are of
- * no conceivable interested to the user. Note that local history is maintained
- * with each individual project, and gets discarded when a project is deleted
- * from the workspace. Hence <code>KEEP_HISTORY</code> is only really applicable
- * when moving files and folders, but not whole projects.
- * </p>
- * <p>
- * Update flags other than <code>FORCE</code> and <code>KEEP_HISTORY</code>
- * are ignored.
- * </p>
- * <p>
- * This method changes resources; these changes will be reported
- * in a subsequent resource change event that will include
- * an indication that the resource has been removed from its parent
- * and that a corresponding resource has been added to its new parent.
- * Additional information provided with resource delta shows that these
- * additions and removals are related.
- * </p>
- * <p>
- * This method is long-running; progress and cancellation are provided
- * by the given progress monitor.
- * </p>
- *
- * @param description the destination project description
- * @param updateFlags bit-wise or of update flag constants
- * (<code>FORCE</code> and <code>KEEP_HISTORY</code>)
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @exception CoreException if this resource could not be moved. Reasons include:
- * <ul>
- * <li> This resource does not exist.</li>
- * <li> This resource or one of its descendents is not local.</li>
- * <li> This resource is not a project.</li>
- * <li> The project at the destination already exists.</li>
- * <li> This resource or one of its descendents is out of sync with the local file system
- * and <code>FORCE</code> is not specified.</li>
- * <li> The workspace and the local file system are out of sync
- * at the destination resource or one of its descendents.</li>
- * <li> Resource changes are disallowed during certain types of resource change
- * event notification. See IResourceChangeEvent for more details.</li>
- * </ul>
- * @see IResourceDelta#getFlags
- * @see #FORCE
- * @see #KEEP_HISTORY
- * @since 2.0
- */
-public void move(IProjectDescription description, int updateFlags, IProgressMonitor monitor) throws CoreException;
-
/**
* Moves this resource so that it is located at the given path.
* The path of the resource must not be a prefix of the destination path.
@@ -1480,6 +1376,147 @@
* @since 2.0
*/
public void move(IPath destination, int updateFlags, IProgressMonitor monitor) throws CoreException;
+/**
+ * Renames or relocates this project so that it is the project specified by the given project
+ * description.
+ * <p>
+ * This is a convenience method, fully equivalent to:
+ * <pre>
+ * move(description, (keepHistory ? KEEP_HISTORY : IResource.NONE) | (force ? FORCE : IResource.NONE), monitor);
+ * </pre>
+ * </p>
+ * <p>
+ * This operation changes resources; these changes will be reported
+ * in a subsequent resource change event that will include
+ * an indication that the resource has been removed from its parent
+ * and that a corresponding resource has been added to its new parent.
+ * Additional information provided with resource delta shows that these
+ * additions and removals are related.
+ * </p>
+ * <p>
+ * This method is long-running; progress and cancellation are provided
+ * by the given progress monitor.
+ * </p>
+ *
+ * @param description the destination project description
+ * @param force a flag controlling whether resources that are not
+ * in sync with the local file system will be tolerated
+ * @param keepHistory a flag indicating whether or not to keep
+ * local history for files
+ * @param monitor a progress monitor, or <code>null</code> if progress
+ * reporting and cancellation are not desired
+ * @exception CoreException if this resource could not be moved. Reasons include:
+ * <ul>
+ * <li> This resource does not exist.</li>
+ * <li> This resource or one of its descendents is not local.</li>
+ * <li> This resource is not a project.</li>
+ * <li> The project at the destination already exists.</li>
+ * <li> This resource or one of its descendents is out of sync with the local file
+ * system and <code>force</code> is <code>false</code>.</li>
+ * <li> The workspace and the local file system are out of sync
+ * at the destination resource or one of its descendents.</li>
+ * <li> Resource changes are disallowed during certain types of resource change
+ * event notification. See IResourceChangeEvent for more details.</li>
+ * </ul>
+ * @see IResourceDelta#getFlags
+ */
+public void move(IProjectDescription description, boolean force, boolean keepHistory, IProgressMonitor monitor) throws CoreException;
+
+
+
+/**
+ * Renames or relocates this project so that it is the project specified by the given
+ * project description. The description specifies the name, location and attributes
+ * of the new project. After successful completion, the old project and
+ * any direct or indirect members will no longer exist; but corresponding
+ * new resources will now exist at the project.
+ * <p>
+ * When a resource moves, its session and persistent properties move
+ * with it. Likewise for all the other attributes of the resource including
+ * markers.
+ * </p>
+ * <p>
+ * When this project's location is the default location, then the directories
+ * and files on disk are moved to be in
+ * the location specified by the given description. If the given description
+ * specifies the default location for the project, the directories and files
+ * are moved to the default location. In all other cases the directories and
+ * files on disk are left untouched. If the name in the given description is
+ * the same as this project's name and the location is different, then the
+ * project contents will be moved to the new location. All other parts of the
+ * given description are ignored.
+ * </p>
+ * <p>
+ * The <code>FORCE</code> update flag controls how this method deals with
+ * cases where the workspace is not completely in sync with the local file
+ * system. If <code>FORCE</code> is not specified, the method will only attempt
+ * to move resources that are in sync with the corresponding files and
+ * directories in the local file system; it will fail if it
+ * encounters a resource that is out of sync with the file system.
+ * However, if <code>FORCE</code> is specified, the method
+ * moves all corresponding files and directories from the local
+ * file system, including ones that have been recently updated or created.
+ * Note that in both settings of the <code>FORCE</code> flag,
+ * the operation fails if the newly created resources in the
+ * workspace would be out of sync with the local file system;
+ * this ensures files in the file system cannot be accidentally
+ * overwritten.
+ * </p>
+ * <p>
+ * The <code>KEEP_HISTORY</code> update flag controls whether or not
+ * file that are about to be deleted from the local file system have their
+ * current contents saved in the workspace's local history. The local history
+ * mechanism serves as a safety net to help the user recover from mistakes that
+ * might otherwise result in data loss. Specifying <code>KEEP_HISTORY</code>
+ * is recommended except in circumstances where past states of the files are of
+ * no conceivable interested to the user. Note that local history is maintained
+ * with each individual project, and gets discarded when a project is deleted
+ * from the workspace. Hence <code>KEEP_HISTORY</code> is only really applicable
+ * when moving files and folders, but not whole projects.
+ * </p>
+ * <p>
+ * Update flags other than <code>FORCE</code> and <code>KEEP_HISTORY</code>
+ * are ignored.
+ * </p>
+ * <p>
+ * This method changes resources; these changes will be reported
+ * in a subsequent resource change event that will include
+ * an indication that the resource has been removed from its parent
+ * and that a corresponding resource has been added to its new parent.
+ * Additional information provided with resource delta shows that these
+ * additions and removals are related.
+ * </p>
+ * <p>
+ * This method is long-running; progress and cancellation are provided
+ * by the given progress monitor.
+ * </p>
+ *
+ * @param description the destination project description
+ * @param updateFlags bit-wise or of update flag constants
+ * (<code>FORCE</code> and <code>KEEP_HISTORY</code>)
+ * @param monitor a progress monitor, or <code>null</code> if progress
+ * reporting and cancellation are not desired
+ * @exception CoreException if this resource could not be moved. Reasons include:
+ * <ul>
+ * <li> This resource does not exist.</li>
+ * <li> This resource or one of its descendents is not local.</li>
+ * <li> This resource is not a project.</li>
+ * <li> The project at the destination already exists.</li>
+ * <li> This resource or one of its descendents is out of sync with the local file system
+ * and <code>FORCE</code> is not specified.</li>
+ * <li> The workspace and the local file system are out of sync
+ * at the destination resource or one of its descendents.</li>
+ * <li> Resource changes are disallowed during certain types of resource change
+ * event notification. See IResourceChangeEvent for more details.</li>
+ * </ul>
+ * @see IResourceDelta#getFlags
+ * @see #FORCE
+ * @see #KEEP_HISTORY
+ * @since 2.0
+ */
+public void move(IProjectDescription description, int updateFlags, IProgressMonitor monitor) throws CoreException;
+
+
/**
* Refreshes the resource hierarchy from this resource and its
@@ -1517,6 +1554,52 @@
*/
public void refreshLocal(int depth, IProgressMonitor monitor) throws CoreException;
/**
+ * Sets whether this resource subtree is marked as derived.
+ * <p>
+ * A <b>derived</b> resource is a regular file or folder that is
+ * created in the course of translating, compiling, copying, or otherwise
+ * processing other files. Derived resources are not original data, and can be
+ * recreated from other resources. It is commonplace to exclude derived
+ * resources from version and configuration management because they would
+ * otherwise clutter the team repository with version of these ever-changing
+ * files as each user regenerates them.
+ * </p>
+ * <p>
+ * If a resource or any of its ancestors is marked as derived, a team
+ * provider should assume that the resource is not under version and
+ * configuration management <it>by default</it>. That is, the resource
+ * should only be stored in a team repository if the user explicitly indicates
+ * that this resource is worth saving.
+ * </p>
+ * <p>
+ * Newly-created resources are not marked as derived; rather, the mark must be
+ * set explicitly using <code>setDerived(true)</code>. Derived marks are maintained
+ * in the in-memory resource tree, and are discarded when the resources is deleted.
+ * Derived marks are saved to disk when a project is closed, or when the workspace
+ * is saved.
+ * </p>
+ * <p>
+ * Projects and the workspace root are never considered derived; attempts to
+ * mark them as derived are ignored.
+ * </p>
+ * <p>
+ * This operation does <b>not</b> result in a resource change event, and does not
+ * trigger auto-builds.
+ * </p>
+ *
+ * @param isDerived <code>true</code> if this resource is to be marked
+ * as derived, and <code>false</code> otherwise
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li> This resource does not exist.</li>
+ * <li> Resource changes are disallowed during certain types of resource change
+ * event notification. See IResourceChangeEvent for more details.</li>
+ * </ul>
+ * @see #isDerived
+ * @since 2.0
+ */
+public void setDerived(boolean isDerived) throws CoreException;
+/**
* Set whether or not this resource and its members (to the
* specified depth) are expected to have their contents (and properties)
* available locally. The workspace root and projects are always local and
@@ -1615,102 +1698,6 @@
*/
public void setSessionProperty(QualifiedName key, Object value) throws CoreException;
/**
- * Marks this resource as having changed even though its content
- * may not have changed. This method can be used to trigger
- * the rebuilding of resources/structures derived from this resource.
- * Touching the workspace root has no effect.
- * </p>
- * <p>
- * This method changes resources; these changes will be reported
- * in a subsequent resource change event.
- * </p>
- * <p>
- * This method is long-running; progress and cancellation are provided
- * by the given progress monitor.
- * </p>
- *
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @exception CoreException if this method fails. Reasons include:
- * <ul>
- * <li> This resource does not exist.</li>
- * <li> This resource is not local.</li>
- * <li> Resource changes are disallowed during certain types of resource change
- * event notification. See IResourceChangeEvent for more details.</li>
- * </ul>
- */
-public void touch(IProgressMonitor monitor) throws CoreException;
-
-/**
- * Returns whether this resource subtree is marked as derived. Returns
- * <code>false</code> if this resource does not exist.
- *
- * @return <code>true</code> if this resource is marked as derived, and
- * <code>false</code> otherwise
- * @see #setDerived
- * @since 2.0
- */
-public boolean isDerived();
-
-/**
- * Sets whether this resource subtree is marked as derived.
- * <p>
- * A <b>derived</b> resource is a regular file or folder that is
- * created in the course of translating, compiling, copying, or otherwise
- * processing other files. Derived resources are not original data, and can be
- * recreated from other resources. It is commonplace to exclude derived
- * resources from version and configuration management because they would
- * otherwise clutter the team repository with version of these ever-changing
- * files as each user regenerates them.
- * </p>
- * <p>
- * If a resource or any of its ancestors is marked as derived, a team
- * provider should assume that the resource is not under version and
- * configuration management <it>by default</it>. That is, the resource
- * should only be stored in a team repository if the user explicitly indicates
- * that this resource is worth saving.
- * </p>
- * <p>
- * Newly-created resources are not marked as derived; rather, the mark must be
- * set explicitly using <code>setDerived(true)</code>. Derived marks are maintained
- * in the in-memory resource tree, and are discarded when the resources is deleted.
- * Derived marks are saved to disk when a project is closed, or when the workspace
- * is saved.
- * </p>
- * <p>
- * Projects and the workspace root are never considered derived; attempts to
- * mark them as derived are ignored.
- * </p>
- * <p>
- * This operation does <b>not</b> result in a resource change event, and does not
- * trigger auto-builds.
- * </p>
- *
- * @param isDerived <code>true</code> if this resource is to be marked
- * as derived, and <code>false</code> otherwise
- * @exception CoreException if this method fails. Reasons include:
- * <ul>
- * <li> This resource does not exist.</li>
- * <li> Resource changes are disallowed during certain types of resource change
- * event notification. See IResourceChangeEvent for more details.</li>
- * </ul>
- * @see #isDerived
- * @since 2.0
- */
-public void setDerived(boolean isDerived) throws CoreException;
-
-/**
- * Returns whether this resource is a team private member of its parent container.
- * Returns <code>false</code> if this resource does not exist.
- *
- * @return <code>true</code> if this resource is a team private member, and
- * <code>false</code> otherwise
- * @see #setTeamPrivateMember
- * @since 2.0
- */
-public boolean isTeamPrivateMember();
-
-/**
* Sets whether this resource subtree is a team private member of its parent container.
* <p>
* A <b>team private member</b> resource is a special file or folder created by a team
@@ -1746,5 +1733,30 @@
* @since 2.0
*/
public void setTeamPrivateMember(boolean isTeamPrivate) throws CoreException;
-
+/**
+ * Marks this resource as having changed even though its content
+ * may not have changed. This method can be used to trigger
+ * the rebuilding of resources/structures derived from this resource.
+ * Touching the workspace root has no effect.
+ * </p>
+ * <p>
+ * This method changes resources; these changes will be reported
+ * in a subsequent resource change event.
+ * </p>
+ * <p>
+ * This method is long-running; progress and cancellation are provided
+ * by the given progress monitor.
+ * </p>
+ *
+ * @param monitor a progress monitor, or <code>null</code> if progress
+ * reporting and cancellation are not desired
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li> This resource does not exist.</li>
+ * <li> This resource is not local.</li>
+ * <li> Resource changes are disallowed during certain types of resource change
+ * event notification. See IResourceChangeEvent for more details.</li>
+ * </ul>
+ */
+public void touch(IProgressMonitor monitor) throws CoreException;
}
diff --git a/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IResourceStatus.java b/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IResourceStatus.java
index c7cb34f..718386f 100644
--- a/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IResourceStatus.java
+++ b/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IResourceStatus.java
@@ -123,6 +123,13 @@
*/
public static final int CASE_VARIANT_EXISTS = 275;
+ /** Status code constant (value 276) indicating a file exists in the
+ * file system but is not of the expected type (file instead of directory,
+ * or vice-versa).
+ * Severity: error. Category: workspace.
+ */
+ public static final int WRONG_TYPE_LOCAL = 276;
+
// Workspace constants [300-398]
// Information Only [300-332]
@@ -184,7 +191,13 @@
* Severity: error. Category: workspace.
*/
public static final int MARKER_NOT_FOUND = 376;
-
+
+ /** Status code constant (value 377) indicating a resource is
+ * unexpectedly not mounted.
+ * Severity: error. Category: workspace.
+ */
+ public static final int RESOURCE_NOT_MOUNTED = 377;
+
// Internal constants [500-598]
// Information Only [500-532]