Class ClassloaderTemplateLoader

java.lang.Object
freemarker.cache.URLTemplateLoader
cn.xuanyuanli.core.util.support.freemarker.ClassloaderTemplateLoader
All Implemented Interfaces:
freemarker.cache.TemplateLoader

public class ClassloaderTemplateLoader extends freemarker.cache.URLTemplateLoader
为解决不能读取jar中目录的问题,拓展Freemarker的TemplateLoader
Author:
John Li
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final String
    路径
  • Constructor Summary

    Constructors
    Constructor
    Description
    模板类加载器加载程序
  • Method Summary

    Modifier and Type
    Method
    Description
    protected URL
    getURL(String name)
    获得url

    Methods inherited from class freemarker.cache.URLTemplateLoader

    canonicalizePrefix, closeTemplateSource, findTemplateSource, getLastModified, getReader, getURLConnectionUsesCaches, setURLConnectionUsesCaches

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • path

      private final String path
      路径
  • Constructor Details

    • ClassloaderTemplateLoader

      public ClassloaderTemplateLoader(String path)
      模板类加载器加载程序
      Parameters:
      path - 路径
  • Method Details

    • getURL

      protected URL getURL(String name)
      获得url
      Specified by:
      getURL in class freemarker.cache.URLTemplateLoader
      Parameters:
      name - 名字
      Returns:
      URL