code: public static String getResourceAsString(String name) throws IOException
    {
      StringWriter writer = new StringWriter();
      Files.copy(getResourceAsReader(name), writer);
      return writer.toString();
    }
docs: Retrieve text resource content as a string. Uses {@link #getResourceAsReader(String)} to reader resource content
  and store it in a String.
  
  @param name resource name.
  @return resource content as string.
  @throws NoSuchBeingException if resource not found.
  @throws IOException if resource reading fails.