@Test public void testReader_Invalid() { assertThrows(LmRuntimeException.class, () -> loader.reader("no-such-resource.xml")); }
@Override public Reader reader(String name) { URL resource = ClasspathResourceResolver.class.getClassLoader().getResource(name); if (resource == null) { throw new LmRuntimeException("Extractor config not found in classpath: " + name); } try { return new InputStreamReader(resource.openStream(), StandardCharsets.UTF_8); } catch (IOException e) { throw new LmRuntimeException("Error reading classpath extractor config XML", e); } }
ClasspathResourceResolver implements ResourceResolver { @Override public Reader reader(String name) { URL resource = ClasspathResourceResolver.class.getClassLoader().getResource(name); if (resource == null) { throw new LmRuntimeException("Extractor config not found in classpath: " + name); } try { return new InputStreamReader(resource.openStream(), StandardCharsets.UTF_8); } catch (IOException e) { throw new LmRuntimeException("Error reading classpath extractor config XML", e); } } }
ClasspathResourceResolver implements ResourceResolver { @Override public Reader reader(String name) { URL resource = ClasspathResourceResolver.class.getClassLoader().getResource(name); if (resource == null) { throw new LmRuntimeException("Extractor config not found in classpath: " + name); } try { return new InputStreamReader(resource.openStream(), StandardCharsets.UTF_8); } catch (IOException e) { throw new LmRuntimeException("Error reading classpath extractor config XML", e); } }  }
ClasspathResourceResolver implements ResourceResolver { @Override public Reader reader(String name) { URL resource = ClasspathResourceResolver.class.getClassLoader().getResource(name); if (resource == null) { throw new LmRuntimeException("Extractor config not found in classpath: " + name); } try { return new InputStreamReader(resource.openStream(), StandardCharsets.UTF_8); } catch (IOException e) { throw new LmRuntimeException("Error reading classpath extractor config XML", e); } }  @Override Reader reader(String name); }
ClasspathResourceResolver implements ResourceResolver { @Override public Reader reader(String name) { URL resource = ClasspathResourceResolver.class.getClassLoader().getResource(name); if (resource == null) { throw new LmRuntimeException("Extractor config not found in classpath: " + name); } try { return new InputStreamReader(resource.openStream(), StandardCharsets.UTF_8); } catch (IOException e) { throw new LmRuntimeException("Error reading classpath extractor config XML", e); } }  @Override Reader reader(String name);  }