On Fri, 16 May 2014, aliosha79 wrote:
For this purpose i have write these few code lines:

      File f = new File("MyEmail.eml");
      is= new FileInputStream(f);

      Tika tika = new Tika();
      String mimeType = tika.detect(is);

This will most likely use a fair bit (to possibly all) of the input stream. You'd be much much better off initialising a TikaInputStream from the File object directly

As input of my app i can have every kind of file. In particular i have a
MyEmail.eml file whose content-type is recognized as text/html

I'd suggest you raise a bug, and attach a small file that doesn't detect properly. We can then look at if we can improve the detection

Nick

Reply via email to