Shall I open a bug for this?
On Nov 18, 2010, at 11:34 AM, Grant Ingersoll wrote:
> Hi,
>
> I'm using MimeTypes::public MimeType getMimeType(String name, byte[] data)
>
> And have noticed a peculiarity in the code:
> // First, try to get the mime-type from the content
> MimeType mimeType = getMimeType(data); ///////// HERE
>
> // If no mime-type found, then try to get the mime-type from
> // the document name
> if (mimeType == null) {
> mimeType = getMimeType(name);
> }
>
> return mimeType;
>
>
> The issue is that the fall through condition is never met, because the first
> call to getMimeType() (marked with HERE) always returns a value.
>
> My test case is I am feeding it a .mbox file and it is returning that it is a
> text/plain instead of application/mbox
>
> I'm on Tika 0.8.
>
> Thanks,
> Grant