code: public static SanitizedContent fromResource(
        Class<?> contextClass, String resourceName, Charset charset, ContentKind kind)
        throws IOException {
      pretendValidateResource(resourceName, kind);
      return SanitizedContent.create(
          Resources.toString(Resources.getResource(contextClass, resourceName), charset),
          kind,
          // Text resources are usually localized, so one might think that the locale direction should
          // be assumed for them. We do not do that because:
          // - We do not know the locale direction here.
          // - Some messages do not get translated.
          // - This method currently can't be used for text resources (see pretendValidateResource()).
          kind.getDefaultDir());
    }
docs: Loads assumed-safe content from a Java resource.
  
  <p>This performs ZERO VALIDATION of the data, and takes you on your word that the input is
  valid. We assume that resources should be safe because they are part of the binary, and
  therefore not attacker controlled, unless the source code is compromised (in which there's
  nothing we can do).
  
  @param contextClass Class relative to which to load the resource.
  @param resourceName The name of the resource, relative to the context class.
  @param charset The character set to use, usually Charsets.UTF_8.
  @param kind The content kind of the resource.