You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tika.apache.org by "Gembusch, Sebastian" <Se...@incowia.com> on 2012/09/20 08:58:59 UTC

Extracting MIME type for not readable files with NameDetector

Hello,

I want to use the NameDetector from the chapter "Resource Name Based
Detection" at http://tika.apache.org/1.2/detection.html to detect the
file type of files, which cannot be read (like C:\hiberfil.sys or
others). In the JavaDoc for Tika I have seen that the constructor of the
NameDetector class needs patterns as parameters. Is there a simple way
to instantiate NameDetector with the patterns from tika-mimetypes.xml? I
haven't found a suitable example in the internet or in the Tika source
code yet and I don't want to parse the xml file by myself, to manually
extract the patterns. There may also be another way to achieve my goal,
so I'm hoping for suggestions.

Thanks,
Sebastian