home *** CD-ROM | disk | FTP | other *** search
- package XMLConsumer;
-
- import BsscXML.IBsscXMLElementReader;
- import hhapplet.URLFileHandler;
- import java.net.MalformedURLException;
- import java.net.URL;
- import java.util.Enumeration;
- import java.util.Hashtable;
-
- public class Toc extends Consumer {
- private URL m_rootURL = null;
- private Hashtable m_hPrjPath = null;
- private URL m_projURL = null;
- private String m_sRootTocPath = null;
-
- public Toc(URL var1, URL var2) {
- super(var1);
- this.m_projURL = var2;
- this.m_hPrjPath = new Hashtable();
- }
-
- public void consume(IBsscXMLElementReader var1) {
- if (var1.getName().equals("toc")) {
- String var2 = var1.getAttribute("root");
-
- try {
- this.m_rootURL = URLFileHandler.makeURL(((Consumer)this).getURL(), var2, (String)null);
- } catch (MalformedURLException var7) {
- ((Throwable)var7).printStackTrace();
- }
-
- int var3 = 0;
-
- while(true) {
- IBsscXMLElementReader var4 = var1.getChild(var3++);
- if (var4 == null) {
- break;
- }
-
- if (var4.getName().equals("project")) {
- String var5 = var4.getAttribute("url");
- String var6 = var4.getAttribute("path");
- if (var5 != null && var6 != null) {
- this.m_hPrjPath.put(var5, var6);
- }
- }
- }
- }
-
- }
-
- public URL getProjURL() {
- return this.m_projURL;
- }
-
- public URL getRootTocURL() {
- return this.m_rootURL;
- }
-
- public String getRootTocPath() {
- return this.m_sRootTocPath;
- }
-
- public void setRootTocPath(String var1) {
- this.m_sRootTocPath = var1;
- }
-
- public String getProjTocPath(String var1) {
- return (String)this.m_hPrjPath.get(var1);
- }
-
- public Enumeration getRemoteProjPaths() {
- return this.m_hPrjPath.keys();
- }
- }
-