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 SummaryFieldsModifier and TypeFieldDescriptionstatic final StringPrefix used for SAXException messagestatic final PreventLocalEntityResolverSingleton instance of PreventLocalEntityResolverprotected static final Logger
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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_BASEPrefix used for SAXException message- See Also:
 
- 
LOGGER
- 
INSTANCESingleton instance of PreventLocalEntityResolver
 
- 
- 
Constructor Details- 
PreventLocalEntityResolverprotected PreventLocalEntityResolver()
 
- 
- 
Method Details- 
resolveEntity- Specified by:
- resolveEntityin interface- EntityResolver
- Throws:
- SAXException
- IOException
 
- 
getExternalSubset- Specified by:
- getExternalSubsetin interface- EntityResolver2
- Throws:
- SAXException
- IOException
 
- 
resolveEntitypublic 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:
- resolveEntityin interface- EntityResolver2
- Throws:
- SAXException
- IOException
 
 
-