code: public static String getResourceAsString(Class<?> clazz, String resource) throws IOException {
          try (InputStream inputStream = clazz.getResourceAsStream(resource)) {
              return IoUtils.toString(inputStream);
          }
      }
docs: Retrieve {@link String} for the file located in resources.
  {@code
  String html = getResourceAsString(MyClass.class, "/index.html");
  }