Class DBEntityResolver

java.lang.Object
edu.ucsb.nceas.metacat.DBEntityResolver
All Implemented Interfaces:
EntityResolver

public class DBEntityResolver extends Object implements EntityResolver
A database aware Class implementing EntityResolver interface for the SAX parser to call when processing the XML stream and intercepting any external entities (including the external DTD subset and external parameter entities, if any) before including them.
  • Constructor Details

    • DBEntityResolver

      public DBEntityResolver()
      Construct an instance of the DBEntityResolver class
    • DBEntityResolver

      public DBEntityResolver(DefaultHandler handler, Reader dtd)
      Construct an instance of the DBEntityResolver class
      Parameters:
      handler - the SAX handler to determine parsing context
      dtd - Reader of new dtd to be uploaded on server's file system
  • Method Details

    • resolveEntity

      public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
      The Parser call this method before opening any external entity except the top-level document entity (including the external DTD subset, external entities referenced within the DTD, and external entities referenced within the document element)
      Specified by:
      resolveEntity in interface EntityResolver
      Throws:
      SAXException
      IOException
    • checkURLConnection

      public static InputStream checkURLConnection(String systemId) throws SAXException
      Check URL Connection for @systemId, and return an InputStream that can be used to read from the systemId URL. The parser ends up using this via the InputSource to read the DTD.
      Parameters:
      systemId - a URI (in practice URL) to be checked and opened
      Throws:
      SAXException