[
https://issues.apache.org/jira/browse/TIKA-1620?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chris A. Mattmann resolved TIKA-1620.
-------------------------------------
Resolution: Fixed
Fix Version/s: 1.9
Fixed! Thanks [~pascal.essiembre]!
{noformat}
commit -m "- fix for TIKA-1620: OUTPUT_FILE_TOKEN not being replaced in
ExternalParser contributed by Pascal Essiembre"
/Users/mattmann/src/tika-core/src/main/java/org/apache/tika/parser/external/ExternalParser.java
Sending
/Users/mattmann/src/tika-core/src/main/java/org/apache/tika/parser/external/ExternalParser.java
Transmitting file data ...
Committed revision 1678117.
{noformat}
> OUTPUT_FILE_TOKEN not being replaced in ExternalParser
> ------------------------------------------------------
>
> Key: TIKA-1620
> URL: https://issues.apache.org/jira/browse/TIKA-1620
> Project: Tika
> Issue Type: Bug
> Components: parser
> Affects Versions: 1.7, 1.8
> Environment: Any.
> Reporter: Pascal Essiembre
> Fix For: 1.9
>
> Original Estimate: 5m
> Remaining Estimate: 5m
>
> According to class documentation, the
> {{org.apache.tika.parser.external.ExternalParser}} class should replace the
> {{OUTPUT_FILE_TOKEN}} constant with an output file name when specified as a
> command argument. It is currently not the case and the parser will fail to
> grab any output from processes generating output files.
> In order to fix this, you should add one line to the following code in the
> parse method (starting on line 168):
> {code:java}
> if(cmd[i].indexOf(OUTPUT_FILE_TOKEN) != -1) {
> output = tmp.createTemporaryFile();
> outputFromStdOut = false;
> //START FIX:
> cmd[i] = cmd[i].replace(OUTPUT_FILE_TOKEN, output.getPath());
> //END FIX.
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)