File tree 1 file changed +3
-2
lines changed
spring-boot-project/spring-boot/src/main/java/org/springframework/boot
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 16
16
17
17
package org .springframework .boot ;
18
18
19
+ import java .io .InputStream ;
19
20
import java .io .PrintStream ;
20
21
import java .nio .charset .Charset ;
21
22
import java .nio .charset .StandardCharsets ;
@@ -63,8 +64,8 @@ public ResourceBanner(Resource resource) {
63
64
64
65
@ Override
65
66
public void printBanner (Environment environment , Class <?> sourceClass , PrintStream out ) {
66
- try {
67
- String banner = StreamUtils .copyToString (this . resource . getInputStream () ,
67
+ try ( InputStream input = this . resource . getInputStream ()) {
68
+ String banner = StreamUtils .copyToString (input ,
68
69
environment .getProperty ("spring.banner.charset" , Charset .class , StandardCharsets .UTF_8 ));
69
70
for (PropertyResolver resolver : getPropertyResolvers (environment , sourceClass )) {
70
71
banner = resolver .resolvePlaceholders (banner );
You can’t perform that action at this time.
0 commit comments