You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tika.apache.org by Mark <mz...@basistech.com> on 2011/04/07 21:52:03 UTC

Which mime type in ParseUtils.getStringContent() ?

I have a InputStream to an unknown file and would like to extract text from it -
using ParseUtils.getStringContent(java.io.InputStream stream, TikaConfig config,
java.lang.String mimeType). Which mimeType should I use?

Thanks.


Re: Which mime type in ParseUtils.getStringContent() ?

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Thu, Apr 7, 2011 at 9:52 PM, Mark <mz...@basistech.com> wrote:
> I have a InputStream to an unknown file and would like to extract text from it -
> using ParseUtils.getStringContent(java.io.InputStream stream, TikaConfig config,
> java.lang.String mimeType). Which mimeType should I use?

Please use the org.apache.tika.Tika facade class instead of the old
ParseUtils class.

The code to parse an unknown file or an input stream with the Tika
facade is simply:

    String text = new Tika().parseToString(file);

or

    String text = new Tika().parseToString(stream);

See [1] for the details.

[1] http://tika.apache.org/0.9/api/org/apache/tika/Tika.html

BR,

Jukka Zitting