summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2007-05-04 13:44:35 (EDT)
committerpelder2007-05-04 13:44:35 (EDT)
commit28813612cbf1f837e22b78007a6d45ea61b45875 (patch)
tree489393cf3c77d0460058633f30a66c309ac1bfd7
parent788b235b9e010459d9c799044a59100040a78a27 (diff)
downloadorg.eclipse.jet-28813612cbf1f837e22b78007a6d45ea61b45875.zip
org.eclipse.jet-28813612cbf1f837e22b78007a6d45ea61b45875.tar.gz
org.eclipse.jet-28813612cbf1f837e22b78007a6d45ea61b45875.tar.bz2
[185432] Correctly resolve locations not contained with-in the workspace
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/TagUtil.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/TagUtil.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/TagUtil.java
index b9f644d..39f8ca1 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/TagUtil.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/TagUtil.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 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
@@ -19,6 +19,7 @@ package org.eclipse.jet.taglib;
import java.net.MalformedURLException;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
@@ -49,7 +50,9 @@ public class TagUtil
*/
public static String getContents(IPath location) throws CoreException
{
- final IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(location);
+ final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ final IFile[] findFilesForLocation = root.findFilesForLocation(location);
+ final IFile file = findFilesForLocation.length > 0 ? findFilesForLocation[0] : null;
if(file != null) {
String encoding = file.getCharset();
try