/** Parses zk.xml, specified by url, into the configuration. * * @param url the URL of zk.xml. */ public void parse(URL url, Configuration config, Locator locator) throws Exception { if (url == null || config == null) throw new IllegalArgumentException("null"); log.info("Parsing " + url); parse(new SAXBuilder(true, false, true).build(url).getRootElement(), config, locator); }
final URL cfgUrl = res.url; try { parser.parse(cfgUrl, config, loc); } catch (Throwable ex) { log.error("Unable to load " + cfgUrl, ex); final URL cfgUrl = _ctx.getResource(XML); if (cfgUrl != null) parser.parse(cfgUrl, config, new ServletContextLocator(_ctx, true)); is = Servlets.getResourceAsStream(_ctx, XML); if (is != null) parser.parse(is, config, new ServletContextLocator(_ctx, true)); else log.error("File not found: " + XML);
/** Parses zk.xml from an input stream into the configuration. * @param is the input stream of zk.xml * @since 5.0.7 */ public void parse(InputStream is, Configuration config, Locator locator) throws Exception { if (is == null || config == null) throw new IllegalArgumentException("null"); parse(new SAXBuilder(true, false, true).build(is).getRootElement(), config, locator); }