/** * Puts a template into the loader. The name can contain slashes to denote * logical directory structure, but must not start with a slash. If the * method is called multiple times for the same name and with different * last modified time, the configuration's template cache will reload the * template according to its own refresh settings (note that if the refresh * is disabled in the template cache, the template will not be reloaded). * Also, since the cache uses lastModified to trigger reloads, calling the * method with different source and identical timestamp won't trigger * reloading. * * <p>Note that this method is not thread safe! Don't call it after FreeMarker has started using this template * loader. * * @param name the name of the template. * @param templateContent the source code of the template. * @param lastModified the time of last modification of the template in * terms of <tt>System.currentTimeMillis()</tt> */ public void putTemplate(String name, String templateContent, long lastModified) { templates.put(name, new StringTemplateSource(name, templateContent, lastModified)); }
/** * Puts a template into the loader. The name can contain slashes to denote * logical directory structure, but must not start with a slash. If the * method is called multiple times for the same name and with different * last modified time, the configuration's template cache will reload the * template according to its own refresh settings (note that if the refresh * is disabled in the template cache, the template will not be reloaded). * Also, since the cache uses lastModified to trigger reloads, calling the * method with different source and identical timestamp won't trigger * reloading. * * <p>Note that this method is not thread safe! Don't call it after FreeMarker has started using this template * loader. * * @param name the name of the template. * @param templateContent the source code of the template. * @param lastModified the time of last modification of the template in * terms of <tt>System.currentTimeMillis()</tt> */ public void putTemplate(String name, String templateContent, long lastModified) { templates.put(name, new StringTemplateSource(name, templateContent, lastModified)); }
/** * Puts a template into the loader. The name can contain slashes to denote * logical directory structure, but must not start with a slash. If the * method is called multiple times for the same name and with different * last modified time, the configuration's template cache will reload the * template according to its own refresh settings (note that if the refresh * is disabled in the template cache, the template will not be reloaded). * Also, since the cache uses lastModified to trigger reloads, calling the * method with different source and identical timestamp won't trigger * reloading. * * <p>Note that this method is not thread safe! Don't call it after FreeMarker has started using this template * loader. * * @param name the name of the template. * @param templateContent the source code of the template. * @param lastModified the time of last modification of the template in * terms of <tt>System.currentTimeMillis()</tt> */ public void putTemplate(String name, String templateContent, long lastModified) { templates.put(name, new StringTemplateSource(name, templateContent, lastModified)); }
/** * Puts a template into the loader. The name can contain slashes to denote * logical directory structure, but must not start with a slash. If the * method is called multiple times for the same name and with different * last modified time, the configuration's template cache will reload the * template according to its own refresh settings (note that if the refresh * is disabled in the template cache, the template will not be reloaded). * Also, since the cache uses lastModified to trigger reloads, calling the * method with different source and identical timestamp won't trigger * reloading. * @param name the name of the template. * @param templateSource the source code of the template. * @param lastModified the time of last modification of the template in * terms of <tt>System.currentTimeMillis()</tt> */ public void putTemplate(String name, String templateSource, long lastModified) { templates.put(name, new StringTemplateSource(name, templateSource, lastModified)); }