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 ;
@@ -64,8 +65,8 @@ public ResourceBanner(Resource resource) {
64
65
65
66
@ Override
66
67
public void printBanner (Environment environment , Class <?> sourceClass , PrintStream out ) {
67
- try {
68
- String banner = StreamUtils .copyToString (this . resource . getInputStream () ,
68
+ try ( InputStream input = this . resource . getInputStream ()) {
69
+ String banner = StreamUtils .copyToString (input ,
69
70
environment .getProperty ("spring.banner.charset" , Charset .class , StandardCharsets .UTF_8 ));
70
71
for (PropertyResolver resolver : getPropertyResolvers (environment , sourceClass )) {
71
72
banner = resolver .resolvePlaceholders (banner );
You can’t perform that action at this time.
0 commit comments