@Test public void testUnknownParser() throws Exception { ServiceLoader ignoreLoader = new ServiceLoader( getClass().getClassLoader(), LoadErrorHandler.IGNORE); ServiceLoader warnLoader = new ServiceLoader( getClass().getClassLoader(), LoadErrorHandler.WARN); ServiceLoader throwLoader = new ServiceLoader( getClass().getClassLoader(), LoadErrorHandler.THROW); Path configPath = Paths.get(new URI(getConfigPath("TIKA-1700-unknown-parser.xml"))); TikaConfig ignore = new TikaConfig(configPath, ignoreLoader); assertNotNull(ignore); assertNotNull(ignore.getParser()); assertEquals(1, ((CompositeParser)ignore.getParser()).getAllComponentParsers().size()); TikaConfig warn = new TikaConfig(configPath, warnLoader); assertNotNull(warn); assertNotNull(warn.getParser()); assertEquals(1, ((CompositeParser)warn.getParser()).getAllComponentParsers().size()); try { new TikaConfig(configPath, throwLoader); fail("Shouldn't get here, invalid parser class"); } catch (TikaException expected) {} }
public Parser getParser(MediaType mimeType) { return parser.getParsers().get(mimeType); }
TikaConfig { public Parser getParser(MediaType mimeType) { return parser.getParsers().get(mimeType); } }
TikaConfig { public Parser getParser(MediaType mimeType) { return parser.getParsers().get(mimeType); } TikaConfig(String file);  TikaConfig(Path path);  TikaConfig(Path path, ServiceLoader loader);  TikaConfig(File file);  TikaConfig(File file, ServiceLoader loader);  TikaConfig(URL url);  TikaConfig(URL url, ClassLoader loader);  TikaConfig(URL url, ServiceLoader loader);  TikaConfig(InputStream stream);  TikaConfig(Document document);  TikaConfig(Document document, ServiceLoader loader);  TikaConfig(Element element);  TikaConfig(Element element, ClassLoader loader); private  TikaConfig(Element element, ServiceLoader loader);  TikaConfig(ClassLoader loader);  TikaConfig(); }
TikaConfig { public Parser getParser(MediaType mimeType) { return parser.getParsers().get(mimeType); } TikaConfig(String file);  TikaConfig(Path path);  TikaConfig(Path path, ServiceLoader loader);  TikaConfig(File file);  TikaConfig(File file, ServiceLoader loader);  TikaConfig(URL url);  TikaConfig(URL url, ClassLoader loader);  TikaConfig(URL url, ServiceLoader loader);  TikaConfig(InputStream stream);  TikaConfig(Document document);  TikaConfig(Document document, ServiceLoader loader);  TikaConfig(Element element);  TikaConfig(Element element, ClassLoader loader); private  TikaConfig(Element element, ServiceLoader loader);  TikaConfig(ClassLoader loader);  TikaConfig(); Parser getParser(MediaType mimeType); Parser getParser(); Detector getDetector(); EncodingDetector getEncodingDetector(); Translator getTranslator(); ExecutorService getExecutorService(); MimeTypes getMimeRepository(); MediaTypeRegistry getMediaTypeRegistry(); ServiceLoader getServiceLoader(); MetadataFilter getMetadataFilter(); static TikaConfig getDefaultConfig(); }
TikaConfig { public Parser getParser(MediaType mimeType) { return parser.getParsers().get(mimeType); } TikaConfig(String file);  TikaConfig(Path path);  TikaConfig(Path path, ServiceLoader loader);  TikaConfig(File file);  TikaConfig(File file, ServiceLoader loader);  TikaConfig(URL url);  TikaConfig(URL url, ClassLoader loader);  TikaConfig(URL url, ServiceLoader loader);  TikaConfig(InputStream stream);  TikaConfig(Document document);  TikaConfig(Document document, ServiceLoader loader);  TikaConfig(Element element);  TikaConfig(Element element, ClassLoader loader); private  TikaConfig(Element element, ServiceLoader loader);  TikaConfig(ClassLoader loader);  TikaConfig(); Parser getParser(MediaType mimeType); Parser getParser(); Detector getDetector(); EncodingDetector getEncodingDetector(); Translator getTranslator(); ExecutorService getExecutorService(); MimeTypes getMimeRepository(); MediaTypeRegistry getMediaTypeRegistry(); ServiceLoader getServiceLoader(); MetadataFilter getMetadataFilter(); static TikaConfig getDefaultConfig();  }