I think Tika.parseToString (static sugar method) closes the
InputStream for you, while the Parser.parse method does not?  Kinda
confusing!

Mark, do you have specific docs that show this?  Then we can boil this
down to a test case...

Mike McCandless

http://blog.mikemccandless.com

On Tue, Aug 30, 2011 at 1:51 PM, Mark Kerzner <[email protected]> wrote:
> I tried TikaInputStream, and I also close it, but I still get the same
> behavior. You can see the deleted but open files in the attached screen
> image
> Mark
>
> On Tue, Aug 30, 2011 at 12:36 PM, Mark Kerzner <[email protected]>
> wrote:
>>
>> Nick,
>> the documentation specifically says that tika closes this input stream. I
>> used to close it myself, but having read this documentation page, took this
>> closing out.
>> I will try TikaInputStream, to see if this fixes the problem.
>> Mark
>>
>> On Tue, Aug 30, 2011 at 12:26 PM, Nick Burch <[email protected]>
>> wrote:
>>>
>>> On Tue, 30 Aug 2011, Mark Kerzner wrote:
>>>>
>>>> String text = tika.parseToString(new FileInputStream(new
>>>> File(fileName)),
>>>> metadata);
>>>
>>> Is that in your code our Tika?
>>>
>>> If you open a FileInputStream, then you yourself need to close it too
>>>
>>> Also, if you have a File, you're better off wrapping it in a
>>> TikaInputStream rather than a FileInputStream, as some parsers prefer a File
>>> and Tika can then use that
>>>
>>> Nick
>>
>
>

Reply via email to