src/main/java/org/jboss/util/xml/catalog/Catalog.java
public synchronized void parseCatalog(URL aUrl) throws IOException {
    catalogCwd = aUrl;
    base = aUrl;

    default_override = catalogManager.getPreferPublic();
    catalogManager.debug.message(4, "Parse catalog: " + aUrl.toString());

    DataInputStream inStream = null;
    boolean parsed = false;

    for (int count = 0; !parsed && count < readerArr.size(); count++) {
      CatalogReader reader = (CatalogReader) readerArr.get(count);

      try {
      	inStream = new DataInputStream(aUrl.openStream());
      } catch (FileNotFoundException fnfe) {
        // No catalog; give up!
        break;
      }

      try {
        reader.readCatalog(this, inStream);
        parsed=true;
      } catch (CatalogException ce) {
        if (ce.getExceptionType() == CatalogException.PARSE_FAILED) {
          // give up!
          break;
        } else {
          // try again!
        }
      }

      try {
      	inStream.close();
      } catch (IOException e) {
      	//nop
      }
    }

    if (parsed) parsePendingCatalogs();
  }
public synchronized void parseCatalog(URL aUrl) throws IOException {
    catalogCwd = aUrl;
    base = aUrl;

    default_override = catalogManager.getPreferPublic();
    catalogManager.debug.message(4, "Parse catalog: " + aUrl.toString());

    DataInputStream inStream = null;
    boolean parsed = false;

    for (int count = 0; !parsed && count < readerArr.size(); count++) {
      CatalogReader reader = (CatalogReader) readerArr.get(count);

      try {
      	inStream = new DataInputStream(aUrl.openStream());
      } catch (FileNotFoundException fnfe) {
        // No catalog; give up!
        break;
      }

      try {
        reader.readCatalog(this, inStream);
        parsed=true;
      } catch (CatalogException ce) {
        if (ce.getExceptionType() == CatalogException.PARSE_FAILED) {
          // give up!
          break;
        } else {
          // try again!
        }
      }

      try {
      	inStream.close();
      } catch (IOException e) {
      	//nop
      }
    }

    if (parsed) parsePendingCatalogs();
  }
Parse a catalog document, augmenting internal data structures.

<p>This method supports catalog files stored in jar files: e.g.,
jar:file:///path/to/filename.jar!/path/to/catalog.xml". That URI
doesn't survive transmogrification through the URI processing that
the parseCatalog(String) performs and passing it as an input stream
doesn't set the base URI appropriately.</p>

<p>Written by Stefan Wachter (2002-09-26)</p>

@param aUrl The URL of the catalog document to process

@throws IOException Error reading catalog file.