Package 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:
org.xml.sax.ContentHandler
,org.xml.sax.DTDHandler
,org.xml.sax.EntityResolver
,org.xml.sax.ErrorHandler
public class OfflineContentHandler extends ContentHandlerDecorator
Content handler decorator that always returns an empty stream from theresolveEntity(String, String)
method to prevent potential network or other external resources from being accessed by an XML parser.- See Also:
- TIKA-185
-
-
Constructor Summary
Constructors Constructor Description OfflineContentHandler(org.xml.sax.ContentHandler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.xml.sax.InputSource
resolveEntity(java.lang.String publicId, java.lang.String systemId)
Returns an empty stream.-
Methods inherited from class org.apache.tika.sax.ContentHandlerDecorator
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, toString
-
-
-
-
Method Detail
-
resolveEntity
public org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
Returns an empty stream. This will make an XML parser silently ignore any external entities.- Specified by:
resolveEntity
in interfaceorg.xml.sax.EntityResolver
- Overrides:
resolveEntity
in classorg.xml.sax.helpers.DefaultHandler
-
-