[114255] Dropping fixes for Rob Frost
diff --git a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/resources/VirtualResource.java b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/resources/VirtualResource.java
index d648ec3..c0c601a 100644
--- a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/resources/VirtualResource.java
+++ b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/resources/VirtualResource.java
@@ -292,4 +292,28 @@
return aRuntimePath.isPrefixOf(getRuntimePath());
}
+ /* (non-Javadoc)
+ * @see org.eclipse.wst.common.componentcore.resources.IVirtualResource#removeLink(org.eclipse.core.runtime.IPath, int, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void removeLink(IPath aProjectRelativeLocation, int updateFlags, IProgressMonitor monitor) throws CoreException {
+ StructureEdit moduleCore = null;
+ try {
+ moduleCore = StructureEdit.getStructureEditForWrite(getProject());
+ WorkbenchComponent component = moduleCore.getComponent();
+ ResourceTreeRoot root = ResourceTreeRoot.getDeployResourceTreeRoot(component);
+ ComponentResource[] resources = root.findModuleResources(getRuntimePath(), ResourceTreeNode.CREATE_NONE);
+ if (resources.length > 0) {
+ for (int resourceIndx = 0; resourceIndx < resources.length; resourceIndx++) {
+ if (aProjectRelativeLocation.makeAbsolute().equals(resources[resourceIndx].getSourcePath())) {
+ component.getResources().remove(resources[resourceIndx]);
+ }
+ }
+ }
+ } finally {
+ if (moduleCore != null) {
+ moduleCore.saveIfNecessary(monitor);
+ moduleCore.dispose();
+ }
+ }
+ }
}
diff --git a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/resources/IVirtualResource.java b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/resources/IVirtualResource.java
index 8085f85..eee8e16 100644
--- a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/resources/IVirtualResource.java
+++ b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/resources/IVirtualResource.java
@@ -147,6 +147,19 @@
*/
public void createLink(IPath aProjectRelativeLocation, int updateFlags, IProgressMonitor monitor) throws CoreException;
+ /**
+ * Removes the mapping, if it exists, from the supplied location to the runtime path of this
+ * virtual resource. Model changes will occur as a result of this method,
+ * and potentially resource-level creations as well.
+ *
+ * @param aProjectRelativeLocation A project relative location whose mapping to the runtime path of this object should be removed.
+ * @param updateFlags A bitmask of flags to supply to the method.
+ * @param monitor
+ * @throws CoreException
+ */
+ public void removeLink(IPath aProjectRelativeLocation, int updateFlags, IProgressMonitor monitor) throws CoreException;
+
+
/**
* Remove the resource from the flexible structure. Removing the resource could require
* changes to the underlying metamodel or changes to the file structure. To avoid