public class FreemarkerTemplateLoader extends Object implements freemarker.cache.TemplateLoader
"this_es_MX.ftl" matches "this_es_MX.ftl" "this_es.ftl" matches "this_es.ftl" or "this_es_MX.ftl" "this.ftl" matches "this.ftl" or "this_es.ftl" or "this_es_MX.ftl"This allows Freemarker to mimic the behavior of the language filtering RDF service, because if Freemarker does not find a match for "this_es_MX.ftl", it will try again with "this_es.ftl" and "this.ftl". So the net effect is that a search for "silly_es_MX.ftl" would eventually return any of these, in order of preference:
silly_es_MX.ftl silly_es.ftl silly_es_*.ftl silly.ftl silly_*.ftlIf more than one template file qualifies, we choose by best fit, shortest path, and alphabetical order, to insure that identical requests produce identical results.
| Constructor and Description |
|---|
FreemarkerTemplateLoader(File baseDir) |
| Modifier and Type | Method and Description |
|---|---|
void |
closeTemplateSource(Object templateSource)
Nothing to do here.
|
Object |
findTemplateSource(String name)
Get the best template for this name.
|
long |
getLastModified(Object templateSource)
Ask the file when it was last modified.
|
Reader |
getReader(Object templateSource,
String encoding)
Get a Reader on this File.
|
public FreemarkerTemplateLoader(File baseDir)
public Object findTemplateSource(String name) throws IOException
findTemplateSource in interface freemarker.cache.TemplateLoaderIOExceptionpublic long getLastModified(Object templateSource)
getLastModified in interface freemarker.cache.TemplateLoadertemplateSource - a File that was obtained earlier from findTemplateSource().public Reader getReader(Object templateSource, String encoding) throws IOException
getReader in interface freemarker.cache.TemplateLoadertemplateSource - a File that was obtained earlier from findTemplateSource().IOExceptionpublic void closeTemplateSource(Object templateSource) throws IOException
closeTemplateSource in interface freemarker.cache.TemplateLoadertemplateSource - a File that was obtained earlier from findTemplateSource().IOExceptionCopyright © 2021. All rights reserved.