@PostConstruct void init() { ResourceLoader resourceLoader = new DefaultResourceLoader(); String location = environment.getProperty("banner.image.location"); if (StringUtils.hasLength(location)) { addBanner(resourceLoader, location, resource -> new ImageBanner(resource)); } else { for (String ext : SUPPORTED_IMAGES) { addBanner(resourceLoader, "banner." + ext, resource -> new ImageBanner(resource)); } } addBanner(resourceLoader, environment.getProperty("banner.location", "banner.txt"), resource -> new ResourceBanner(resource)); }
private static Banner hymirBanner() { Resource resource = new ClassPathResource("banner.txt"); return new ResourceBanner(resource); }
private Banner getBanner() { ClassPathResource banner = new ClassPathResource("remote-banner.txt", RemoteSpringApplication.class); return new ResourceBanner(banner); }