/* */ public void readCatalog(Catalog catalog, InputStream is)
/* */ throws IOException, CatalogException
/* */ {
/* 233 */ if ((this.parserFactory == null) && (this.parserClass == null)) {
/* 234 */ this.debug.message(1, "Cannot read SAX catalog without a parser");
/* 235 */ throw new CatalogException(6);
/* */ }
/* */
/* 238 */ this.debug = catalog.getCatalogManager().debug;
/* 239 */ EntityResolver bResolver = catalog.getCatalogManager().getBootstrapResolver();
/* */
/* 241 */ this.catalog = catalog;
/* */ try
/* */ {
/* 244 */ if (this.parserFactory != null) {
/* 245 */ SAXParser parser = this.parserFactory.newSAXParser();
/* 246 */ SAXParserHandler spHandler = new SAXParserHandler();
/* 247 */ spHandler.setContentHandler(this);
/* 248 */ if (bResolver != null) {
/* 249 */ spHandler.setEntityResolver(bResolver);
/* */ }
/* 251 */ parser.parse(new InputSource(is), spHandler);
/* */ } else {
/* 253 */ Parser parser = (Parser)Class.forName(this.parserClass, true, this.loader != null ? this.loader : getClass().getClassLoader()).newInstance();
/* 254 */ parser.setDocumentHandler(this);
/* 255 */ if (bResolver != null) {
/* 256 */ parser.setEntityResolver(bResolver);
/* */ }
/* 258 */ parser.parse(new InputSource(is));
/* */ }
/* */ } catch (ClassNotFoundException cnfe) {
/* 261 */ throw new CatalogException(6);
/* */ } catch (IllegalAccessException iae) {
/* 263 */ throw new CatalogException(6);
/* */ } catch (InstantiationException ie) {
/* 265 */ throw new CatalogException(6);
/* */ } catch (ParserConfigurationException pce) {
/* 267 */ throw new CatalogException(5);
/* */ } catch (SAXException se) {
/* 269 */ Exception e = se.getException();
/* */
/* 271 */ UnknownHostException uhe = new UnknownHostException();
/* 272 */ FileNotFoundException fnfe = new FileNotFoundException();
/* 273 */ if (e != null) {
/* 274 */ if (e.getClass() == uhe.getClass()) {
/* 275 */ throw new CatalogException(7, e.toString());
/* */ }
/* 277 */ if (e.getClass() == fnfe.getClass()) {
/* 278 */ throw new CatalogException(7, e.toString());
/* */ }
/* */ }
/* */
/* 282 */ throw new CatalogException(se);
/* */ }
/* */ }