Package org.apache.tika.parser
Class CryptoParser
java.lang.Object
org.apache.tika.parser.DelegatingParser
org.apache.tika.parser.CryptoParser
- All Implemented Interfaces:
Serializable
,Parser
Decrypts the incoming document stream and delegates further parsing to
another parser instance. The decryption key and other settings as well
as the delegate parser are taken from the parsing context.
- Since:
- Apache Tika 0.10
- See Also:
-
Constructor Summary
ConstructorDescriptionCryptoParser
(String transformation, Provider provider, Set<MediaType> types) CryptoParser
(String transformation, Set<MediaType> types) -
Method Summary
Modifier and TypeMethodDescriptiongetSupportedTypes
(ParseContext context) Returns the set of media types supported by this parser when used with the given parse context.void
parse
(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) Looks up the delegate parser from the parsing context and delegates the parse operation to it.Methods inherited from class org.apache.tika.parser.DelegatingParser
getDelegateParser
-
Constructor Details
-
CryptoParser
-
CryptoParser
-
-
Method Details
-
getSupportedTypes
Description copied from interface:Parser
Returns the set of media types supported by this parser when used with the given parse context.- Specified by:
getSupportedTypes
in interfaceParser
- Overrides:
getSupportedTypes
in classDelegatingParser
- Parameters:
context
- parse context- Returns:
- immutable set of media types
-
parse
public void parse(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException Description copied from class:DelegatingParser
Looks up the delegate parser from the parsing context and delegates the parse operation to it. If a delegate parser is not found, then an empty XHTML document is returned.Subclasses should override this method to parse the top level structure of the given document stream. Parsed sub-streams can be passed to this base class method to be parsed by the configured delegate parser.
- Specified by:
parse
in interfaceParser
- Overrides:
parse
in classDelegatingParser
- Parameters:
stream
- the document stream (input)handler
- handler for the XHTML SAX events (output)metadata
- document metadata (input and output)context
- parse context- Throws:
IOException
- if the document stream could not be readSAXException
- if the SAX events could not be processedTikaException
- if the document could not be parsed
-