@Test public void testReader() throws IOException { try (Reader r = resolver.reader("dummy.xml")) { assertNotNull(r); char[] buffer = new char[100]; int read = r.read(buffer, 0, buffer.length); assertEquals("<dummy/>", new String(buffer, 0, read)); } }
@Override public Reader reader(String name) { File file = getFile(name); LOGGER.info("Will extract XML from {}", file.getAbsolutePath()); try { return new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8); } catch (IOException e) { throw new LmRuntimeException("Error reading extractor config XML from file " + file, e); } }
FolderResourceResolver implements ResourceResolver { @Override public Reader reader(String name) { File file = getFile(name); LOGGER.info("Will extract XML from {}", file.getAbsolutePath()); try { return new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8); } catch (IOException e) { throw new LmRuntimeException("Error reading extractor config XML from file " + file, e); } } }
FolderResourceResolver implements ResourceResolver { @Override public Reader reader(String name) { File file = getFile(name); LOGGER.info("Will extract XML from {}", file.getAbsolutePath()); try { return new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8); } catch (IOException e) { throw new LmRuntimeException("Error reading extractor config XML from file " + file, e); } } FolderResourceResolver(File baseDir); }
FolderResourceResolver implements ResourceResolver { @Override public Reader reader(String name) { File file = getFile(name); LOGGER.info("Will extract XML from {}", file.getAbsolutePath()); try { return new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8); } catch (IOException e) { throw new LmRuntimeException("Error reading extractor config XML from file " + file, e); } } FolderResourceResolver(File baseDir); @Override Reader reader(String name); @Override boolean needsReload(String location, long lastLoadedOn); }
FolderResourceResolver implements ResourceResolver { @Override public Reader reader(String name) { File file = getFile(name); LOGGER.info("Will extract XML from {}", file.getAbsolutePath()); try { return new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8); } catch (IOException e) { throw new LmRuntimeException("Error reading extractor config XML from file " + file, e); } } FolderResourceResolver(File baseDir); @Override Reader reader(String name); @Override boolean needsReload(String location, long lastLoadedOn);  }