Example usage for org.springframework.boot.autoconfigure.template TemplateLocation exists

List of usage examples for org.springframework.boot.autoconfigure.template TemplateLocation exists

Introduction

In this page you can find the example usage for org.springframework.boot.autoconfigure.template TemplateLocation exists.

Prototype

public boolean exists(ResourcePatternResolver resolver) 

Source Link

Document

Determine if this template location exists using the specified ResourcePatternResolver .

Usage

From source file:com.breakidea.noah.configure.VelocityAutoConfiguration.java

@PostConstruct
public void checkTemplateLocationExists() {
    if (this.properties.isCheckTemplateLocation()) {
        TemplateLocation location = new TemplateLocation(this.properties.getResourceLoaderPath());
        if (!location.exists(this.applicationContext)) {
            logger.warn("Cannot find template location: " + location
                    + " (please add some templates, check your Velocity "
                    + "configuration, or set spring.velocity." + "checkTemplateLocation=false)");
        }/*from  ww  w . ja  v  a2 s.  c  o  m*/
    }
}

From source file:org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration.java

@PostConstruct
public void checkTemplateLocationExists() {
    if (this.properties.isCheckTemplateLocation()) {
        TemplateLocation templatePathLocation = null;
        List<TemplateLocation> locations = new ArrayList<TemplateLocation>();
        for (String templateLoaderPath : this.properties.getTemplateLoaderPath()) {
            TemplateLocation location = new TemplateLocation(templateLoaderPath);
            locations.add(location);//from  w  w w  .  j  a  v  a 2s . c  om
            if (location.exists(this.applicationContext)) {
                templatePathLocation = location;
                break;
            }
        }
        if (templatePathLocation == null) {
            logger.warn("Cannot find template location(s): " + locations + " (please add some templates, "
                    + "check your FreeMarker configuration, or set "
                    + "spring.freemarker.checkTemplateLocation=false)");
        }
    }
}

From source file:org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration.java

@PostConstruct
public void checkTemplateLocationExists() {
    if (this.mustache.isCheckTemplateLocation()) {
        TemplateLocation location = new TemplateLocation(this.mustache.getPrefix());
        if (!location.exists(this.applicationContext)) {
            logger.warn("Cannot find template location: " + location
                    + " (please add some templates, check your Mustache "
                    + "configuration, or set spring.mustache." + "check-template-location=false)");
        }//www .  jav a  2s  .co  m
    }
}

From source file:org.springframework.boot.autoconfigure.thymeleaf.AbstractTemplateResolverConfiguration.java

@PostConstruct
public void checkTemplateLocationExists() {
    boolean checkTemplateLocation = this.properties.isCheckTemplateLocation();
    if (checkTemplateLocation) {
        TemplateLocation location = new TemplateLocation(this.properties.getPrefix());
        if (!location.exists(this.applicationContext)) {
            logger.warn("Cannot find template location: " + location + " (please add some templates or check "
                    + "your Thymeleaf configuration)");
        }/*from   w  ww.ja  va  2s  . c  o m*/
    }
}