1 11 package org.eclipse.help.internal.toc; 12 13 import java.io.FileInputStream ; 14 import java.io.IOException ; 15 import java.io.InputStream ; 16 17 import org.eclipse.help.internal.util.ResourceLocator; 18 19 22 public class TocFile { 23 24 private String pluginId; 25 private String file; 26 private boolean isPrimary; 27 private String locale; 28 private String extraDir; 29 private String category; 30 31 public TocFile(String pluginId, String file, boolean isPrimary, String locale, String extradir, String category) { 32 this.pluginId = pluginId; 33 this.file = file; 34 this.isPrimary = isPrimary; 35 this.locale = locale; 36 this.extraDir = extradir; 37 this.category = category; 38 } 39 40 public String getCategory() { 41 return category; 42 } 43 44 public String getExtraDir() { 45 return extraDir; 46 } 47 48 public String getFile() { 49 return file; 50 } 51 52 public InputStream getInputStream() throws IOException { 53 if (pluginId != null) { 54 return ResourceLocator.openFromPlugin(pluginId, file, locale); 55 } 56 else { 57 return new FileInputStream (file); 58 } 59 } 60 61 public String getLocale() { 62 return locale; 63 } 64 65 public String getPluginId() { 66 return pluginId; 67 } 68 69 public boolean isPrimary() { 70 return isPrimary; 71 } 72 } 73 | Popular Tags |