@Test public void shouldFetchFromStaticResource() throws Exception { final String json = new StaticResourceClassInspector(new DefaultResourceLoader()).fetchJsonFor("twitter4j.Status", null); assertThat(json).isNotEmpty(); }
@Override protected String fetchJsonFor(final String fullyQualifiedName, final Context<Void> context) throws IOException { final String path = PREFIX + fullyQualifiedName + SUFFIX; final Resource[] resources = resolver.getResources(path); if (resources.length == 0) { throw new FileNotFoundException(path); } final Resource resource = resources[0]; try (InputStream in = resource.getInputStream()) { return IOUtils.toString(in, StandardCharsets.UTF_8); } }
StaticResourceClassInspector extends DataMapperBaseInspector<Void> { @Override protected String fetchJsonFor(final String fullyQualifiedName, final Context<Void> context) throws IOException { final String path = PREFIX + fullyQualifiedName + SUFFIX; final Resource[] resources = resolver.getResources(path); if (resources.length == 0) { throw new FileNotFoundException(path); } final Resource resource = resources[0]; try (InputStream in = resource.getInputStream()) { return IOUtils.toString(in, StandardCharsets.UTF_8); } } }
StaticResourceClassInspector extends DataMapperBaseInspector<Void> { @Override protected String fetchJsonFor(final String fullyQualifiedName, final Context<Void> context) throws IOException { final String path = PREFIX + fullyQualifiedName + SUFFIX; final Resource[] resources = resolver.getResources(path); if (resources.length == 0) { throw new FileNotFoundException(path); } final Resource resource = resources[0]; try (InputStream in = resource.getInputStream()) { return IOUtils.toString(in, StandardCharsets.UTF_8); } } @Autowired  StaticResourceClassInspector(final ResourceLoader loader); }
StaticResourceClassInspector extends DataMapperBaseInspector<Void> { @Override protected String fetchJsonFor(final String fullyQualifiedName, final Context<Void> context) throws IOException { final String path = PREFIX + fullyQualifiedName + SUFFIX; final Resource[] resources = resolver.getResources(path); if (resources.length == 0) { throw new FileNotFoundException(path); } final Resource resource = resources[0]; try (InputStream in = resource.getInputStream()) { return IOUtils.toString(in, StandardCharsets.UTF_8); } } @Autowired  StaticResourceClassInspector(final ResourceLoader loader);  }
StaticResourceClassInspector extends DataMapperBaseInspector<Void> { @Override protected String fetchJsonFor(final String fullyQualifiedName, final Context<Void> context) throws IOException { final String path = PREFIX + fullyQualifiedName + SUFFIX; final Resource[] resources = resolver.getResources(path); if (resources.length == 0) { throw new FileNotFoundException(path); } final Resource resource = resources[0]; try (InputStream in = resource.getInputStream()) { return IOUtils.toString(in, StandardCharsets.UTF_8); } } @Autowired  StaticResourceClassInspector(final ResourceLoader loader);   }