public class PreventLocalEntityResolver extends Object implements EntityResolver2, Serializable
When parsing an XML entity reference to a local file a SAXException is thrown, which can be handled appropriately.
This implementation is both recommended and the default returned by GeoTools#getEntityResolver()
.
Modifier and Type | Field and Description |
---|---|
static String |
ERROR_MESSAGE_BASE
Prefix used for SAXException message
|
static PreventLocalEntityResolver |
INSTANCE
Singleton instance of PreventLocalEntityResolver
|
protected static Logger |
LOGGER |
Modifier | Constructor and Description |
---|---|
protected |
PreventLocalEntityResolver() |
Modifier and Type | Method and Description |
---|---|
InputSource |
getExternalSubset(String name,
String baseURI) |
InputSource |
resolveEntity(String publicId,
String systemId) |
InputSource |
resolveEntity(String name,
String publicId,
String baseURI,
String systemId)
Tells the parser to resolve the systemId against the baseURI and read the entity text from
that resulting absolute URI.
|
public static final String ERROR_MESSAGE_BASE
protected static final Logger LOGGER
public static final PreventLocalEntityResolver INSTANCE
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
resolveEntity
in interface EntityResolver
SAXException
IOException
public InputSource getExternalSubset(String name, String baseURI) throws SAXException, IOException
getExternalSubset
in interface EntityResolver2
SAXException
IOException
public InputSource resolveEntity(String name, String publicId, String baseURI, String systemId) throws SAXException, IOException
DefaultHandler.resolveEntity()
, method is overridden to call this one, this method may
sometimes be invoked with null name and baseURI, and with the
systemId already absolutized.resolveEntity
in interface EntityResolver2
SAXException
IOException
Copyright © 1996–2019 Geotools. All rights reserved.