Class DefaultTemplate

  • All Implemented Interfaces:
    Template

    public class DefaultTemplate
    extends Object
    implements Template
    A template implementation that resolves template resources relative the template base. The root URL as well as URLs of relative resource names are first prepended with the specified path before resolving against the base.
    Since:
    3.0
    • Constructor Detail

      • DefaultTemplate

        public DefaultTemplate​(io.bootique.resource.FolderResourceFactory base,
                               String path,
                               String name,
                               Charset sourceEncoding)
    • Method Detail

      • getUrl

        public URL getUrl()
        Description copied from interface: Template
        Returns a URL of this template
        Specified by:
        getUrl in interface Template
      • getUrl

        public URL getUrl​(String resourceName)
        Description copied from interface: Template
        Returns a URL of a related resource (such as sub-template).
        Specified by:
        getUrl in interface Template
      • resourcePath

        protected String resourcePath​(String resource)
      • checkPathWithinBounds

        protected static void checkPathWithinBounds​(String resourcePath)