Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDejan Gloszic2006-02-09 23:19:41 +0000
committerDejan Gloszic2006-02-09 23:19:41 +0000
commit045f60cde766d1b467d923ea03db0ecf31c18723 (patch)
treee9298b22706b6cad4cf893ef3263618a42d15cbb /org.eclipse.ua.tests/base/org/eclipse/ua/tests/util
parent58eb0b1860f4e1a18a276ffbe39120026e02cb27 (diff)
downloadeclipse.platform.ua-045f60cde766d1b467d923ea03db0ecf31c18723.tar.gz
eclipse.platform.ua-045f60cde766d1b467d923ea03db0ecf31c18723.tar.xz
eclipse.platform.ua-045f60cde766d1b467d923ea03db0ecf31c18723.zip
127104[Help] Ability to filter out context help topics
Diffstat (limited to 'org.eclipse.ua.tests/base/org/eclipse/ua/tests/util')
-rw-r--r--org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java
index 23dfc7433..00d67c292 100644
--- a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java
+++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java
@@ -14,6 +14,7 @@ import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.net.URL;
import org.eclipse.core.runtime.Platform;
import org.osgi.framework.Bundle;
@@ -28,7 +29,11 @@ public class FileUtil {
* as a String (file must be encoded as UTF-8).
*/
public static String getContents(Bundle bundle, String relativePath) throws IOException {
- return readString(bundle.getEntry(relativePath).openStream());
+ URL url = bundle.getEntry(relativePath);
+ if (url != null) {
+ return readString(url.openStream());
+ }
+ return null;
}
/**

Back to the top