File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 1616
1717package com .flowci .core ;
1818
19+ import com .flowci .util .StringHelper ;
20+ import lombok .extern .log4j .Log4j2 ;
21+ import org .springframework .beans .factory .annotation .Autowired ;
1922import org .springframework .boot .SpringApplication ;
2023import org .springframework .boot .autoconfigure .SpringBootApplication ;
24+ import org .springframework .context .event .ContextRefreshedEvent ;
25+ import org .springframework .context .event .EventListener ;
26+ import org .springframework .core .io .Resource ;
27+ import org .springframework .core .io .ResourceLoader ;
28+
29+ import java .io .IOException ;
2130
2231/**
2332 * @author yang
2433 */
34+ @ Log4j2
2535@ SpringBootApplication
2636public class Application {
2737
38+ @ Autowired
39+ private ResourceLoader resourceLoader ;
40+
41+ @ EventListener (ContextRefreshedEvent .class )
42+ public void printBanner () throws IOException {
43+ Resource r = resourceLoader .getResource ("classpath:welcome.txt" );
44+ log .info (StringHelper .toString (r .getInputStream ()));
45+ }
46+
2847 public static void main (String [] args ) {
2948 SpringApplication .run (Application .class , args );
3049 }
Original file line number Diff line number Diff line change 1+
2+ _ _ __ _ _
3+ __ __ ___ | | ___ ___ _ __ ___ ___ | |_ ___ / _|| | ___ __ __ ___ (_)
4+ \ \ /\ / / / _ \| | / __| / _ \ | '_ ` _ \ / _ \ | __| / _ \ | |_ | | / _ \ \ \ /\ / / / __|| |
5+ \ V V / | __/| || (__ | (_) || | | | | || __/ | |_ | (_) | | _|| || (_) | \ V V / _ | (__ | |
6+ \_/\_/ \___||_| \___| \___/ |_| |_| |_| \___| \__| \___/ |_| |_| \___/ \_/\_/ (_) \___||_|
7+
You can’t perform that action at this time.
0 commit comments