private static XmlParser initParser() { XmlParser parser = new XmlParser(); URL config60 = Loader.getResource(XmlConfiguration.class, "org/eclipse/jetty/xml/configure_6_0.dtd"); URL config76 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_7_6.dtd"); URL config90 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_9_0.dtd"); parser.redirectEntity("configure.dtd",config90); parser.redirectEntity("configure_1_0.dtd",config60); parser.redirectEntity("configure_1_1.dtd",config60); parser.redirectEntity("configure_1_2.dtd",config60); parser.redirectEntity("configure_1_3.dtd",config60); parser.redirectEntity("configure_6_0.dtd",config60); parser.redirectEntity("configure_7_6.dtd",config76); parser.redirectEntity("configure_9_0.dtd",config90); parser.redirectEntity("http://jetty.mortbay.org/configure.dtd",config90); parser.redirectEntity("http://jetty.eclipse.org/configure.dtd",config90); parser.redirectEntity("http://www.eclipse.org/jetty/configure.dtd",config90); parser.redirectEntity("-//Mort Bay Consulting//DTD Configure//EN",config90); parser.redirectEntity("-//Jetty//Configure//EN",config90); return parser; }
@Override protected InputSource resolveEntity(String pid, String sid) { if (!mapped) { mapResources(); mapped=true; } InputSource is = super.resolveEntity(pid,sid); return is; }
/** * Reads and parses the XML configuration file. * * @param f an XML configuration file * @throws IOException if the configuration could not be read * @throws SAXException if the configuration could not be parsed */ public static XmlParser.Node parse(File f) throws SAXException, IOException { // we don't expect to need this very often, // so just make a new parser every time return initParser().parse(f); }
/** * Constructor. */ public XmlParser(boolean validating) { setValidating(validating); }
protected void redirect(XmlParser parser, String resource, URL source) { if (source != null) parser.redirectEntity(resource, source); }
String dtd = _parser.getDTD(); if (dtd != null && dtd.indexOf("web-app_2_2") >= 0)
public XmlParser newParser() throws ClassNotFoundException XmlParser xmlParser=new XmlParser();
/** * Parse String URL. */ public synchronized Node parse(String url) throws IOException, SAXException { if (LOG.isDebugEnabled()) LOG.debug("parse: " + url); return parse(new InputSource(url)); }
/** * Constructor. */ public XmlParser(boolean validating) { setValidating(validating); }
protected void redirect(XmlParser parser, String resource, URL source) { if (source != null) parser.redirectEntity(resource, source); }
String dtd = _parser.getDTD(); if (dtd != null && dtd.indexOf("web-app_2_2") >= 0)
public XmlParser newParser() throws ClassNotFoundException XmlParser xmlParser=new XmlParser();
/** * Reads and parses the XML configuration file. * * @param configuration the URL of the XML configuration * @throws IOException if the configuration could not be read * @throws SAXException if the configuration could not be parsed */ public XmlConfiguration(URL configuration) throws SAXException, IOException { synchronized (__parser) { _url=configuration; setConfig(__parser.parse(configuration.toString())); _dtd=__parser.getDTD(); } }
/** * Parse String URL. */ public synchronized Node parse(String url) throws IOException, SAXException { if (LOG.isDebugEnabled()) LOG.debug("parse: " + url); return parse(new InputSource(url)); }
private synchronized static XmlParser initParser() { XmlParser parser = new XmlParser(); URL config60 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_6_0.dtd",true); URL config76 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_7_6.dtd",true); parser.redirectEntity("configure.dtd",config76); parser.redirectEntity("configure_1_0.dtd",config60); parser.redirectEntity("configure_1_1.dtd",config60); parser.redirectEntity("configure_1_2.dtd",config60); parser.redirectEntity("configure_1_3.dtd",config60); parser.redirectEntity("configure_6_0.dtd",config60); parser.redirectEntity("configure_7_6.dtd",config76); parser.redirectEntity("http://jetty.mortbay.org/configure.dtd",config76); parser.redirectEntity("http://jetty.eclipse.org/configure.dtd",config76); parser.redirectEntity("http://www.eclipse.org/jetty/configure.dtd",config76); parser.redirectEntity("-//Mort Bay Consulting//DTD Configure//EN",config76); parser.redirectEntity("-//Jetty//Configure//EN",config76); return parser; }
/** * Constructor. */ public XmlParser(boolean validating) { setValidating(validating); }