private static Reader readerFromUrl(String resourceName) throws IOException {
    URL resourceUrl = TemplateVars.class.getResource(resourceName);
    if (resourceUrl == null) {
      throw new IllegalArgumentException("Could not find resource: " + resourceName);
    }
    try {
      if (Ascii.equalsIgnoreCase(resourceUrl.getProtocol(), "file")) {
        return readerFromFile(resourceUrl);
      } else if (Ascii.equalsIgnoreCase(resourceUrl.getProtocol(), "jar")) {
        return readerFromJar(resourceUrl);
      } else {
        return readerFromOther(resourceUrl);
      }
    } catch (URISyntaxException e) {
      throw new IOException(e);
    }
  }
Returns the result of substituting the variables defined by the fields of this class (a
concrete subclass of TemplateVars) into the template returned by {@link #parsedTemplate()}.
value/src/main/java/com/google/auto/value/processor/TemplateVars.java