Package org.geotools.util
Class PreventLocalEntityResolver
Object
PreventLocalEntityResolver
- All Implemented Interfaces:
Serializable
,EntityResolver
,EntityResolver2
EntityResolver implementation to prevent use external entity resolution to local files.
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()
.
- Author:
- Davide Savazzi - geo-solutions.it
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Prefix used for SAXException messagestatic final PreventLocalEntityResolver
Singleton instance of PreventLocalEntityResolverprotected static final Logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetExternalSubset
(String name, String baseURI) resolveEntity
(String publicId, String systemId) 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.
-
Field Details
-
ERROR_MESSAGE_BASE
Prefix used for SAXException message- See Also:
-
LOGGER
-
INSTANCE
Singleton instance of PreventLocalEntityResolver
-
-
Constructor Details
-
PreventLocalEntityResolver
protected PreventLocalEntityResolver()
-
-
Method Details
-
resolveEntity
- Specified by:
resolveEntity
in interfaceEntityResolver
- Throws:
SAXException
IOException
-
getExternalSubset
- Specified by:
getExternalSubset
in interfaceEntityResolver2
- Throws:
SAXException
IOException
-
resolveEntity
public InputSource resolveEntity(String name, String publicId, String baseURI, String systemId) throws SAXException, IOException Tells the parser to resolve the systemId against the baseURI and read the entity text from that resulting absolute URI. Note that because the olderDefaultHandler.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.- Specified by:
resolveEntity
in interfaceEntityResolver2
- Throws:
SAXException
IOException
-