You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Keith R. Bennett (JIRA)" <ji...@apache.org> on 2007/09/28 00:20:50 UTC
[jira] Updated: (TIKA-37) After first stream is parsed, Parser
never replaces content on subsequent streams.
[ https://issues.apache.org/jira/browse/TIKA-37?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Keith R. Bennett updated TIKA-37:
---------------------------------
Attachment: tika37.patch
The fix involves adding a single line of code in the Parser.setInputStream() method:
parsed = false;
The TestParsers class includes a method, testPassingMultipleStreamsToParser(), that tests the fix. To see the problem, comment out the 'parsed = false' line and run the test.
To support the tests, I added 2 methods to Utils:
File createTempTextFile(String fileContent, String prefix, String suffix)
String readFileTextContent(File file)
I figured they could be handy elsewhere, so I put them in Utils. However, if you want to restrict their use to tests and hide these from users, we could put them in the src/test/java tree in a new file.
- Keith
> After first stream is parsed, Parser never replaces content on subsequent streams.
> ----------------------------------------------------------------------------------
>
> Key: TIKA-37
> URL: https://issues.apache.org/jira/browse/TIKA-37
> Project: Tika
> Issue Type: Bug
> Components: general
> Affects Versions: 0.1-incubator
> Reporter: Keith R. Bennett
> Fix For: 0.1-incubator
>
> Attachments: tika37.patch
>
>
> After the first stream is parsed by a parser, the 'parsed' member boolean is set to true. From then on, that boolean is never reset and no further parsing is ever done, even when setInputStream() is called with a different stream.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.