Package freemarker.cache

Examples of freemarker.cache.FileTemplateLoader


            }
            else
            {
               oLog.info( "freemarker > template load path > adding directory > " + oDir.getDir() );

               oTemplateLoaderList.add( new FileTemplateLoader( oDir.getDir() ) );
            }
         }
         else if ( oLoaderPathItem instanceof Config.Templating.TemplatePath.LoaderClass )
         {
            Config.Templating.TemplatePath.LoaderClass oLoaderClass = ( Config.Templating.TemplatePath.LoaderClass ) oLoaderPathItem;
View Full Code Here


     * <p/>
     * The WebappTemplateLoader attempts to resolve templates relative to the web root folder
     */
    protected TemplateLoader getTemplateLoader(ServletContext servletContext) {
        // construct a FileTemplateLoader for the init-param 'TemplatePath'
        FileTemplateLoader templatePathLoader = null;

        String templatePath = servletContext.getInitParameter("TemplatePath");
        if (templatePath == null) {
            templatePath = servletContext.getInitParameter("templatePath");
        }

        if (templatePath != null) {
            try {
                templatePathLoader = new FileTemplateLoader(new File(templatePath));
            } catch (IOException e) {
                log.error("Invalid template path specified: " + e.getMessage(), e);
            }
        }

View Full Code Here

        File file = path.getFile()// will fail if not resolvable in the file system
        if (logger.isDebugEnabled()) {
          logger.debug(
              "Template loader path [" + path + "] resolved to file path [" + file.getAbsolutePath() + "]");
        }
        return new FileTemplateLoader(file);
      }
      catch (IOException ex) {
        if (logger.isDebugEnabled()) {
          logger.debug("Cannot resolve template loader path [" + templateLoaderPath +
              "] to [java.io.File]: using SpringTemplateLoader as fallback", ex);
View Full Code Here

        File file = path.getFile()// will fail if not resolvable in the file system
        if (logger.isDebugEnabled()) {
          logger.debug(
              "Template loader path [" + path + "] resolved to file path [" + file.getAbsolutePath() + "]");
        }
        return new FileTemplateLoader(file);
      }
      catch (IOException ex) {
        if (logger.isDebugEnabled()) {
          logger.debug("Cannot resolve template loader path [" + templateLoaderPath +
              "] to [java.io.File]: using SpringTemplateLoader as fallback", ex);
View Full Code Here

     * <p/>
     * The WebappTemplateLoader attempts to resolve templates relative to the web root folder
     */
    protected TemplateLoader getTemplateLoader(ServletContext servletContext) {
        // construct a FileTemplateLoader for the init-param 'TemplatePath'
        FileTemplateLoader templatePathLoader = null;

        String templatePath = servletContext.getInitParameter("TemplatePath");
        if (templatePath == null) {
            templatePath = servletContext.getInitParameter("templatePath");
        }

        if (templatePath != null) {
            try {
                templatePathLoader = new FileTemplateLoader(new File(templatePath));
            } catch (IOException e) {
                LOG.error("Invalid template path specified: " + e.getMessage(), e);
            }
        }

View Full Code Here

     * <p/>
     * The WebappTemplateLoader attempts to resolve templates relative to the web root folder
     */
    protected TemplateLoader getTemplateLoader(ServletContext servletContext) {
        // construct a FileTemplateLoader for the init-param 'TemplatePath'
        FileTemplateLoader templatePathLoader = null;

        String templatePath = servletContext.getInitParameter("TemplatePath");
        if (templatePath == null) {
            templatePath = servletContext.getInitParameter("templatePath");
        }

        if (templatePath != null) {
            try {
                templatePathLoader = new FileTemplateLoader(new File(templatePath));
            } catch (IOException e) {
                log.error("Invalid template path specified: " + e.getMessage(), e);
            }
        }

View Full Code Here

    private static final Logger LOG = LoggerFactory.getLogger(BundleFreemarkerManager.class);

    @Override
    protected TemplateLoader getTemplateLoader(ServletContext servletContext) {
        // construct a FileTemplateLoader for the init-param 'TemplatePath'
        FileTemplateLoader templatePathLoader = null;

        String templatePath = servletContext.getInitParameter("TemplatePath");
        if (templatePath == null) {
            templatePath = servletContext.getInitParameter("templatePath");
        }

        if (templatePath != null) {
            try {
                templatePathLoader = new FileTemplateLoader(new File(templatePath));
            } catch (IOException e) {
                if (LOG.isErrorEnabled())
                    LOG.error("Invalid template path specified: [#0]", e, e.getMessage());
            }
        }
View Full Code Here

     * <p/>
     * The WebappTemplateLoader attempts to resolve templates relative to the web root folder
     */
    protected TemplateLoader getTemplateLoader(ServletContext servletContext) {
        // construct a FileTemplateLoader for the init-param 'TemplatePath'
        FileTemplateLoader templatePathLoader = null;

        String templatePath = servletContext.getInitParameter("TemplatePath");
        if (templatePath == null) {
            templatePath = servletContext.getInitParameter("templatePath");
        }

        if (templatePath != null) {
            try {
                templatePathLoader = new FileTemplateLoader(new File(templatePath));
            } catch (IOException e) {
                LOG.error("Invalid template path specified: " + e.getMessage(), e);
            }
        }

View Full Code Here

   * The WebappTemplateLoader attempts to resolve templates relative to the
   * web root folder
   */
  protected TemplateLoader getTemplateLoader(ServletContext servletContext) {
    // construct a FileTemplateLoader for the init-param 'TemplatePath'
    FileTemplateLoader templatePathLoader = null;

    String templatePath = servletContext.getInitParameter("TemplatePath");
    if (templatePath == null) {
      templatePath = servletContext.getInitParameter("templatePath");
    }

    if (templatePath != null) {
      try {
        templatePathLoader = new FileTemplateLoader(new File(templatePath));
      } catch (IOException e) {
        logger.error("Invalid template path specified:{} ", e.getMessage(), e);
      }
    }

View Full Code Here

    for (String path : paths) {
      if (path.startsWith("classpath:")) {
        loaders.add(new BeangleClassTemplateLoader(StringUtils.substringAfter(path, "classpath:")));
      } else if (path.startsWith("file:")) {
        try {
          loaders.add(new FileTemplateLoader(new File(path)));
        } catch (IOException e) {
          throw new RuntimeException("templatePath: " + path + " cannot be accessed", e);
        }
      } else if (path.startsWith("webapp:")) {
        loaders.add(new WebappTemplateLoader(servletContext, StringUtils.substringAfter(path,
View Full Code Here

TOP

Related Classes of freemarker.cache.FileTemplateLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.