Example usage for org.springframework.boot ResourceBanner ResourceBanner

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

Introduction

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

Prototype

public ResourceBanner(Resource resource) 

Source Link

Usage

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

private Banner selectBanner(Environment environment) {
    String location = environment.getProperty("banner.location", "banner.txt");
    ResourceLoader resourceLoader = this.resourceLoader != null ? this.resourceLoader
            : new DefaultResourceLoader(getClassLoader());
    Resource resource = resourceLoader.getResource(location);

    if (resource.exists()) {
        return new ResourceBanner(resource);
    }/*from w w w .  j  a  va  2s  .  c o  m*/
    if (this.banner != null) {
        return this.banner;
    }
    return DEFAULT_BANNER;
}

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

private Banner getTextBanner(Environment environment) {
    String location = environment.getProperty(BANNER_LOCATION_PROPERTY, DEFAULT_BANNER_LOCATION);
    Resource resource = this.resourceLoader.getResource(location);
    if (resource.exists()) {
        return new ResourceBanner(resource);
    }/*from  www.j a v  a2s.  c  o m*/
    return null;
}