public static List jarFileContents()

in src/main/java/software/amazon/smithy/lsp/Utils.java [81:97]


  public static List<String> jarFileContents(String rawUri, ClassLoader classLoader) throws IOException {
    String uri = java.net.URLDecoder.decode(rawUri, StandardCharsets.UTF_8.name());
    String[] pathArray = uri.split("!/");
    String resourcePath = pathArray[1];
    InputStream is = classLoader.getResourceAsStream(resourcePath);
    List<String> result = null;
    try {
      if (is != null) {
        InputStreamReader isr = new InputStreamReader(is);
        BufferedReader reader = new BufferedReader(isr);
        result = reader.lines().collect(Collectors.toList());
      }
    } finally {
      is.close();
    }
    return result;
  }