TikaHelper { public boolean isIndexed(String type) { if (!isSupportedMediaType(type)){ return false; } MediaType mediaType = MediaType.parse(type); Parser p = getSupportingParser(parser, mediaType); if (p == null){ return false; } p = unwrap(p); if (p instanceof EmptyParser){ return false; } return true; } TikaHelper(@Nullable File tikaConfig); Parser getParser(); boolean isSupportedMediaType(String type); boolean isIndexed(String type);  }
@Test public void indexedTypes() throws Exception { File config = temporaryFolder.newFile(); String configText = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<properties>\n" + " <detectors>\n" + " <detector class=\"org.apache.tika.detect.DefaultDetector\"/>\n" + " </detectors>\n" + " <parsers>\n" + " <parser class=\"org.apache.tika.parser.DefaultParser\"/>\n" + " <parser class=\"org.apache.tika.parser.EmptyParser\">\n" + " <mime>application/xml</mime>\n" + " </parser>\n" + " </parsers>\n" + "</properties>"; Files.write(configText, config, Charsets.UTF_8); TikaHelper tika = new TikaHelper(config); assertFalse(tika.isIndexed("application/xml")); }