Package edu.ucsb.nceas.metacat
Class DBEntityResolver
java.lang.Object
edu.ucsb.nceas.metacat.DBEntityResolver
- All Implemented Interfaces:
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 Summary
ConstructorDescriptionConstruct an instance of the DBEntityResolver classDBEntityResolver
(DefaultHandler handler, Reader dtd) Construct an instance of the DBEntityResolver class -
Method Summary
Modifier and TypeMethodDescriptionstatic InputStream
checkURLConnection
(String systemId) Check URL Connection for @systemId, and return an InputStream that can be used to read from the systemId URL.resolveEntity
(String publicId, String systemId) 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)
-
Constructor Details
-
DBEntityResolver
public DBEntityResolver()Construct an instance of the DBEntityResolver class -
DBEntityResolver
Construct an instance of the DBEntityResolver class- Parameters:
handler
- the SAX handler to determine parsing contextdtd
- Reader of new dtd to be uploaded on server's file system
-
-
Method Details
-
resolveEntity
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 interfaceEntityResolver
- Throws:
SAXException
IOException
-
checkURLConnection
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
-