org.apache.tika.sax
Class OfflineContentHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.apache.tika.sax.ContentHandlerDecorator
org.apache.tika.sax.OfflineContentHandler
- All Implemented Interfaces:
- ContentHandler, DTDHandler, EntityResolver, ErrorHandler
public class OfflineContentHandler
- extends ContentHandlerDecorator
Content handler decorator that always returns an empty stream from the
resolveEntity(String, String)
method to prevent potential
network or other external resources from being accessed by an XML parser.
- See Also:
- TIKA-185
Methods inherited from class org.apache.tika.sax.ContentHandlerDecorator |
characters, endDocument, endElement, endPrefixMapping, handleException, ignorableWhitespace, processingInstruction, setContentHandler, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, toString |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
error, fatalError, notationDecl, unparsedEntityDecl, warning |
OfflineContentHandler
public OfflineContentHandler(ContentHandler handler)
resolveEntity
public InputSource resolveEntity(String publicId,
String systemId)
- Returns an empty stream. This will make an XML parser silently
ignore any external entities.
- Specified by:
resolveEntity
in interface EntityResolver
- Overrides:
resolveEntity
in class org.xml.sax.helpers.DefaultHandler
Copyright © 2007-2011 The Apache Software Foundation. All Rights Reserved.