tikaondotnet icon indicating copy to clipboard operation
tikaondotnet copied to clipboard

EML file is detected as text/plain

Open sumithub opened this issue 8 years ago • 0 comments

Hi,

We're facing an issue where TikaDotNet is not able to recognize correct MimeType for the attached EML file. When I process the same file through lastest Tika GUI, it outputs Content-Type: message/rfc822 correctly. Below is my code which I used to detect MimeType with TikaDotNet. Any hint/help would be greatly appreciated.

        TikaConfig config = TikaConfig.getDefaultConfig();
        Metadata meta = new Metadata();
        meta.add("ResourceName", existingFile.SourceFileName);
        meta.add("FilePath", existingFile.SourcePath);
        Detector detector = config.getDetector();
        TikaInputStream inputStream = TikaInputStream.@get(header, meta);
        MediaType type = detector.detect(inputStream, meta);

Please change the attached file extension to ".eml" before testing out.

Thanks test.txt

sumithub avatar May 25 '17 06:05 sumithub