code: public static String getResourceAsString(Class<?> requestingClass, String resource)
              throws ResourceMissingException, IOException {
          String line = null;
          BufferedReader in = null;
          StringBuffer sbText = null;
          try {
              in =
                      new BufferedReader(
                              new InputStreamReader(
                                      getResourceAsStream(requestingClass, resource), UTF_8));
              sbText = new StringBuffer(1024);
              while ((line = in.readLine()) != null) sbText.append(line).append("\n");
          } finally {
              if (in != null) in.close();
          }
          return sbText.toString();
      }
docs: Get the contents of a URL as a String
  
  @param requestingClass the java.lang.Class object of the class that is attempting to load the
  resource
  @param resource a String describing the full or partial URL of the resource whose contents to
  load
  @return the actual contents of the resource as a String
  @throws ResourceMissingException
  @throws java.io.IOException