Hi,
Thank for your quick reply.
When I tried to add this line
if(f.getName().endsWith(".txt")){
metadata.add(Metadata.CONTENT_TYPE, "text/plain");
}
It runs OK.
I think when pass argument new FileInputStream(f) to the AutoDetectParser,
it must know file content type based on filename as last resort.
How do you think?
Van
Jukka Zitting wrote:
>
> Hi,
>
> On Tue, Jan 6, 2009 at 11:05 AM, Karl Heinz Marbaise <[email protected]>
> wrote:
>> Just simple set the the RESOURCE_NAME_KEY to the filename of your
>> file....
>> That seemed to be a bug ....I'm not sure about that...
>
> We currently don't have a mechanism that automatically detects whether
> a given input stream contains plain text, so the AutoDetectParser
> needs a filename like "something.txt" to trigger parsing the input
> document as text.
>
> BR,
>
> Jukka Zitting
>
>
--
View this message in context:
http://www.nabble.com/AutodetectParser-fail-with-text-file-tp21307369p21308425.html
Sent from the Apache Tika - Development mailing list archive at Nabble.com.