Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfullbright2011-02-11 22:37:16 +0000
committerpfullbright2011-02-11 22:37:16 +0000
commit8dc3babef631e1fc1572a18ec20be2bf000af3f5 (patch)
tree694a1ce1f62c89bbbc8e9a652bb919d0923af238 /common/plugins/org.eclipse.jpt.common.core
parentda61a134b7393fccb8fdc34e9edfb8a7c31ca70d (diff)
downloadwebtools.dali-8dc3babef631e1fc1572a18ec20be2bf000af3f5.tar.gz
webtools.dali-8dc3babef631e1fc1572a18ec20be2bf000af3f5.tar.xz
webtools.dali-8dc3babef631e1fc1572a18ec20be2bf000af3f5.zip
bug 336553 - fixed file creation for projects in locations other than workspace
Diffstat (limited to 'common/plugins/org.eclipse.jpt.common.core')
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/PlatformTools.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/PlatformTools.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/PlatformTools.java
index 6981696e0d..a63855b794 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/PlatformTools.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/PlatformTools.java
@@ -13,6 +13,7 @@ import java.io.IOException;
import java.io.InputStream;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
@@ -32,7 +33,14 @@ public class PlatformTools {
*/
public static IContainer getContainer(IPath fullContainerPath) {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- return root.getContainerForLocation(root.getLocation().append(fullContainerPath));
+ // changed to handle non-workspace projects
+ String projectName = fullContainerPath.segment(0).toString();
+ IPath projectRelativePath = fullContainerPath.removeFirstSegments(1);
+ IProject project = root.getProject(projectName);
+ if (projectRelativePath.isEmpty()) {
+ return project;
+ }
+ return project.getFolder(projectRelativePath);
}
/**

Back to the top