Thanks Nick, I wasn't looking properly

tikaConfig.getMimeRepository().forName(mediaType.toString());

On Sun, Jul 24, 2011 at 9:59 PM, Jakub Liska <[email protected]> wrote:
> but MimeTypes.getMimeType( );  methods are all deprecated, saying you
> should use Tika.detect( ), that returns String that you can use to get
> MediaType MediaType.parse(string);
>
> I was really searching through the entire code base how to get
> MimeType without it being deprecated and I didn't find anything.
>
> On Sun, Jul 24, 2011 at 6:48 PM, Nick Burch <[email protected]> wrote:
>> On Sun, 24 Jul 2011, Jakub Liska wrote:
>>>
>>> currently it is only possibly to getExtension from MimeType. But there
>>> is no way of getting MimeType from already detected MediaType, to get
>>> the file extension.
>>
>> Start with your TikaConfig, and call getMimeRepository() to get the
>> MimeTypes. From there you should be able to lookup the MimeType for a
>> MediaType
>>
>> Nick
>>
>

Reply via email to