@Test public void givenPathToResource_whenGetResourceInputStreamIsCalled_thenInputStreamIsReturned() { String content = new BufferedReader( new InputStreamReader(getResourceInputStream("eu/dnetlib/iis/common/data/@a/static-resource-file.txt"), StandardCharsets.UTF_8)) .lines() .collect(Collectors.joining("\n")); assertEquals("This is a static resource file.", content); }
public static InputStream getResourceInputStream(String location) { try { return new ClassPathResource(location).getInputStream(); } catch (IOException e) { throw new RuntimeException(e); } }
ClassPathResourceProvider { public static InputStream getResourceInputStream(String location) { try { return new ClassPathResource(location).getInputStream(); } catch (IOException e) { throw new RuntimeException(e); } } }
ClassPathResourceProvider { public static InputStream getResourceInputStream(String location) { try { return new ClassPathResource(location).getInputStream(); } catch (IOException e) { throw new RuntimeException(e); } }  }
ClassPathResourceProvider { public static InputStream getResourceInputStream(String location) { try { return new ClassPathResource(location).getInputStream(); } catch (IOException e) { throw new RuntimeException(e); } }  static String getResourcePath(String location); static String getResourceContent(String location); static List<String> getResourcesContents(String... locations); static InputStream getResourceInputStream(String location); static InputStreamReader getResourceReader(String location); }
ClassPathResourceProvider { public static InputStream getResourceInputStream(String location) { try { return new ClassPathResource(location).getInputStream(); } catch (IOException e) { throw new RuntimeException(e); } }  static String getResourcePath(String location); static String getResourceContent(String location); static List<String> getResourcesContents(String... locations); static InputStream getResourceInputStream(String location); static InputStreamReader getResourceReader(String location);  }