Example usage for org.springframework.boot ImageBanner ImageBanner

List of usage examples for org.springframework.boot ImageBanner ImageBanner

Introduction

In this page you can find the example usage for org.springframework.boot ImageBanner ImageBanner.

Prototype

public ImageBanner(Resource image) 

Source Link

Usage

From source file:org.springframework.boot.SpringApplicationBannerPrinter.java

private Banner getImageBanner(Environment environment) {
    String location = environment.getProperty(BANNER_IMAGE_LOCATION_PROPERTY);
    if (StringUtils.hasLength(location)) {
        Resource resource = this.resourceLoader.getResource(location);
        return (resource.exists() ? new ImageBanner(resource) : null);
    }/*from w  ww. j a  v a  2 s.  c  o  m*/
    for (String ext : IMAGE_EXTENSION) {
        Resource resource = this.resourceLoader.getResource("banner." + ext);
        if (resource.exists()) {
            return new ImageBanner(resource);
        }
    }
    return null;
}