Skip to content

Commit 6f411b7

Browse files
committed
ResourceUtil: Close property file resources.
1 parent bd231ec commit 6f411b7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

metafacture-commons/src/main/java/org/metafacture/commons/ResourceUtil.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ public static URL getUrl(final File file) throws MalformedURLException {
201201
*/
202202
public static Properties loadProperties(final String location)
203203
throws IOException {
204-
return loadProperties(getStream(location));
204+
try (InputStream stream = getStream(location)) {
205+
return loadProperties(stream);
206+
}
205207
}
206208

207209
/**

0 commit comments

Comments
 (0)