tika-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keith R. Bennett (JIRA)" <j...@apache.org>
Subject [jira] Updated: (TIKA-37) After first stream is parsed, Parser never replaces content on subsequent streams.
Date Thu, 27 Sep 2007 22:20:50 GMT

     [ 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.


Mime
View raw message