Package org.apache.tika.embedder
Class ExternalEmbedder
java.lang.Object
org.apache.tika.embedder.ExternalEmbedder
- All Implemented Interfaces:
Serializable,Embedder
Deprecated.
This version of the Apache Tika library is deprecated. Use your own version of Apache Tika.
Embedder that uses an external program (like sed or exiftool) to embed text
content and metadata into a given document.
- Since:
- Apache Tika 1.3
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanDeprecated.Checks to see if the command can be run.static booleanDeprecated.Checks to see if the command can be run.voidembed(Metadata metadata, InputStream inputStream, OutputStream outputStream, ParseContext context) Deprecated.Executes the configured external command and passes the given document stream as a simple XHTML document to the given SAX content handler.String[]Deprecated.Gets the command to be run.Deprecated.Gets the operator to append rather than replace a value for the command line tool, i.e.Deprecated.Gets the delimiter for multiple assignments for the command line tool, i.e.Deprecated.Gets the assignment operator for the command line tool, i.e.Deprecated.Gets the map of Metadata keys to command line parameters.Deprecated.getSupportedEmbedTypes(ParseContext context) Deprecated.Returns the set of media types supported by this embedder when used with the given parse context.booleanDeprecated.Gets whether or not to quote assignment values, i.e.voidsetCommand(String... command) Deprecated.Sets the command to be run.voidsetCommandAppendOperator(String commandAppendOperator) Deprecated.Sets the operator to append rather than replace a value for the command line tool, i.e.voidsetCommandAssignmentDelimeter(String commandAssignmentDelimeter) Deprecated.Sets the delimiter for multiple assignments for the command line tool, i.e.voidsetCommandAssignmentOperator(String commandAssignmentOperator) Deprecated.Sets the assignment operator for the command line tool, i.e.voidsetMetadataCommandArguments(Map<Property, String[]> arguments) Deprecated.Sets the map of Metadata keys to command line parameters.voidsetQuoteAssignmentValues(boolean quoteAssignmentValues) Deprecated.Sets whether or not to quote assignment values, i.e.voidsetSupportedEmbedTypes(Set<MediaType> supportedEmbedTypes) Deprecated.
-
Field Details
-
METADATA_COMMAND_ARGUMENTS_TOKEN
Deprecated.Token to be replaced with a String array of metadata assignment command arguments- See Also:
-
METADATA_COMMAND_ARGUMENTS_SERIALIZED_TOKEN
Deprecated.Token to be replaced with a String array of metadata assignment command arguments- See Also:
-
-
Constructor Details
-
ExternalEmbedder
public ExternalEmbedder()Deprecated.
-
-
Method Details
-
getSupportedEmbedTypes
Deprecated.Description copied from interface:EmbedderReturns the set of media types supported by this embedder when used with the given parse context.The name differs from the precedence of
Parser.getSupportedTypes(ParseContext)so that parser implementations may also choose to implement this interface.- Specified by:
getSupportedEmbedTypesin interfaceEmbedder- Parameters:
context- parse context- Returns:
- immutable set of media types
-
getSupportedEmbedTypes
Deprecated. -
setSupportedEmbedTypes
Deprecated. -
getCommand
Deprecated.Gets the command to be run. This can include either ofExternalParser.INPUT_FILE_TOKENorExternalParser.OUTPUT_FILE_TOKENif the command needs filenames.- Returns:
-
setCommand
Deprecated.Sets the command to be run. This can include either ofExternalParser.INPUT_FILE_TOKENorExternalParser.OUTPUT_FILE_TOKENif the command needs filenames.- See Also:
-
getCommandAssignmentOperator
Deprecated.Gets the assignment operator for the command line tool, i.e. "=".- Returns:
- the assignment operator
-
setCommandAssignmentOperator
Deprecated.Sets the assignment operator for the command line tool, i.e. "=".- Parameters:
commandAssignmentOperator-
-
getCommandAssignmentDelimeter
Deprecated.Gets the delimiter for multiple assignments for the command line tool, i.e. ", ".- Returns:
- the assignment delimiter
-
setCommandAssignmentDelimeter
Deprecated.Sets the delimiter for multiple assignments for the command line tool, i.e. ", ".- Parameters:
commandAssignmentDelimeter-
-
getCommandAppendOperator
Deprecated.Gets the operator to append rather than replace a value for the command line tool, i.e. "+=".- Returns:
- the append operator
-
setCommandAppendOperator
Deprecated.Sets the operator to append rather than replace a value for the command line tool, i.e. "+=".- Parameters:
commandAppendOperator-
-
isQuoteAssignmentValues
public boolean isQuoteAssignmentValues()Deprecated.Gets whether or not to quote assignment values, i.e. tag='value'. The default is false.- Returns:
- whether or not to quote assignment values
-
setQuoteAssignmentValues
public void setQuoteAssignmentValues(boolean quoteAssignmentValues) Deprecated.Sets whether or not to quote assignment values, i.e. tag='value'.- Parameters:
quoteAssignmentValues-
-
getMetadataCommandArguments
Deprecated.Gets the map of Metadata keys to command line parameters.- Returns:
- the metadata to CLI param map
-
setMetadataCommandArguments
Deprecated.Sets the map of Metadata keys to command line parameters. Set this to null to disable Metadata embedding.- Parameters:
arguments-
-
embed
public void embed(Metadata metadata, InputStream inputStream, OutputStream outputStream, ParseContext context) throws IOException, TikaException Deprecated.Executes the configured external command and passes the given document stream as a simple XHTML document to the given SAX content handler. Metadata is only extracted ifsetMetadataCommandArguments(Map)has been called to set arguments.- Specified by:
embedin interfaceEmbedder- Parameters:
metadata- document metadata (input and output)inputStream- the document stream (input)outputStream- the output stream to write the metadata embedded data tocontext- parse context- Throws:
IOException- if the document stream could not be readTikaException- if the document could not be parsed
-
check
Deprecated.Checks to see if the command can be run. Typically used with something like "myapp --version" to check to see if "myapp" is installed and on the path.- Parameters:
checkCmd- the check command to runerrorValue- what is considered an error value?- Returns:
- whether or not the check completed without error
-
check
Deprecated.Checks to see if the command can be run. Typically used with something like "myapp --version" to check to see if "myapp" is installed and on the path.- Parameters:
checkCmd- the check command to runerrorValue- what is considered an error value?- Returns:
- whether or not the check completed without error
-