Author: scabanovich
Date: 2011-07-28 15:55:24 -0400 (Thu, 28 Jul 2011)
New Revision: 33322
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemImpl.java
Log:
JBIDE-9420
https://issues.jboss.org/browse/JBIDE-9420
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemImpl.java 2011-07-28
19:37:21 UTC (rev 33321)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemImpl.java 2011-07-28
19:55:24 UTC (rev 33322)
@@ -89,6 +89,7 @@
return resource = f;
}
+ String wsloc =
ResourcesPlugin.getWorkspace().getRoot().getLocation().toString().replace('\\',
'/');
IContainer f = null;
URI uri = URIUtil.toURI(thloc, true);
IContainer[] cs =
ResourcesPlugin.getWorkspace().getRoot().findContainersForLocationURI(uri);
@@ -109,10 +110,12 @@
if(resource == null) {
f = project.getFolder(new Path(XModelObjectConstants.SEPARATOR +
getAttributeValue(XModelObjectConstants.ATTR_NAME)));
if(!f.exists()) {
+ //Only create link if actual resource exists and
+ //all other means to find resource in workspace failed.
+ //Besides, never create link for actual resources inside workspace -
+ //if they do not appear in the workspace, let them be invisible to model as well.
try {
- if(new File(thloc).exists()) {
- //only create link if actual resource exists and
- //all other means to find resource in workspace failed.
+ if(!thloc.startsWith(wsloc) && new File(thloc).exists()) {
((IFolder)f).createLink(new Path(thloc), IFolder.FORCE, null);
resource = f;
}