1 11 package org.eclipse.help.internal.context; 12 import java.io.*; 13 14 import org.eclipse.core.runtime.*; 15 import org.eclipse.help.internal.util.*; 16 17 public class ContextsFile { 18 protected String href; 19 protected String definingPluginID; 20 protected String pluginID; 21 24 public ContextsFile(String definingPlugin, String href, String plugin) { 25 this.href = href; 26 this.definingPluginID = definingPlugin; 27 this.pluginID = plugin; 28 } 29 34 public String getHref() { 35 return href; 36 } 37 protected InputStream getInputStream() { 38 InputStream stream = null; 39 try { 40 if (definingPluginID != null) 41 stream = ResourceLocator.openFromPlugin(definingPluginID, href, 42 Platform.getNL()); 43 else 44 stream = new FileInputStream(href); 45 } catch (IOException e) { 46 } 47 return stream; 48 } 49 54 public String getDefiningPluginID() { 55 return definingPluginID; 56 } 57 62 public String getPluginID() { 63 return pluginID; 64 } 65 public void build(ContextsBuilder builder) { 66 builder.build(this); 67 } 68 } 69 | Popular Tags |