public Reader getReader()

in src/main/java/com/epam/digital/data/platform/generator/config/SimpleClasspathLoader.java [31:42]


  public Reader getReader(Object name, String encoding) throws IOException {
    URL url = getClass().getClassLoader().getResource(String.valueOf(name));
    if (url == null) {
      throw new IllegalStateException(name + " not found on classpath");
    }
    URLConnection connection = url.openConnection();
    connection.setUseCaches(false);

    InputStream is = connection.getInputStream();

    return new InputStreamReader(is, StandardCharsets.UTF_8);
  }