code: public String getResource(String resource, Map<String, String> replacements)
    {
      String result = cache.get(resource);
      if (result == null)
      {
        try
        {
          InputStream is = MiniProfilerResourceLoader.class.getResourceAsStream(resource);
          try
          {
            result = new Scanner(is).useDelimiter("\\A").next();
          } finally
          {
            is.close();
          }
  
          if (replacements != null)
          {
            for (Map.Entry<String, String> e : replacements.entrySet())
            {
              result = result.replace(e.getKey(), e.getValue());
            }
          }
  
          cache.putIfAbsent(resource, result);
        } catch (Exception e)
        {
          result = null;
        }
      }
      return result;
    }
docs: Get the specified resource (if it exists) and perform the specified string
  replacements on it.
  
  @param resource
  The name of the resource to load.
  @param replacements
  The map of string replacements to do.
  
  @return The text of the resource, or {@code null} if it could not be
  loaded.