Hi,
Yes, It does help and be general.
Thanks,
Van

Jukka Zitting wrote:
> 
> Hi,
> 
> On Tue, Jan 6, 2009 at 11:58 AM, iapilgrim <[email protected]> wrote:
>> When I tried to add this line
>>        if(f.getName().endsWith(".txt")){
>>            metadata.add(Metadata.CONTENT_TYPE, "text/plain");
>>        }
>> It runs OK.
> 
> Better yet, as suggested by Karl, just pass the original file name as
> a part of the metadata:
> 
>     metadata.add(Metadata.RESOURCE_NAME_KEY, f.getName());
> 
> The AutoDetectParser already knows about the ".txt" suffix, and it can
> actually use the file name to guess a number of other content types as
> well. No need for you to encode those rules in your application.
> 
> BR,
> 
> Jukka Zitting
> 
> 

-- 
View this message in context: 
http://www.nabble.com/AutodetectParser-fail-with-text-file-tp21307369p21308587.html
Sent from the Apache Tika - Development mailing list archive at Nabble.com.

Reply via email to