Skip to content

Commit 8cc5a2e

Browse files
committed
close resource stream
1 parent 9b6e531 commit 8cc5a2e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/com/inet/gradle/setup/msi/MsiLocalizedResource.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.io.File;
44
import java.io.IOException;
5+
import java.io.InputStream;
56
import java.nio.charset.StandardCharsets;
67
import java.nio.file.Files;
78
import java.nio.file.StandardOpenOption;
@@ -68,7 +69,9 @@ public File getResource() {
6869

6970
wxlFile.getParentFile().mkdirs();
7071
Properties props = new Properties();
71-
props.load( Files.newInputStream( input.toPath() ) );
72+
try ( InputStream stream = Files.newInputStream( input.toPath() ) ) {
73+
props.load( stream );
74+
}
7275

7376
StringBuilder builder = new StringBuilder();
7477
builder.append( "<?xml version='1.0'?>\n" );

0 commit comments

Comments
 (0)