Mercurial > dive4elements > gnv-client
diff gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java @ 172:b5e55f460f0b
Closed small file descriptor leak in loading SQL properties file.
gnv-artifacts/trunk@209 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 12 Oct 2009 09:19:16 +0000 |
parents | 7fb9441dd8af |
children | 226091ed3cbd |
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java Fri Oct 09 07:54:48 2009 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java Mon Oct 12 09:19:16 2009 +0000 @@ -90,9 +90,18 @@ private Properties getProperties(String filePath) throws FileNotFoundException, IOException { - InputStream inputStream = new FileInputStream(filePath); - Properties properties = new Properties(); - properties.load(inputStream); - return properties; + InputStream inputStream = null; + try { + inputStream = new FileInputStream(filePath); + Properties properties = new Properties(); + properties.load(inputStream); + return properties; + } + finally { + if (inputStream != null) { + try { inputStream.close(); } + catch (IOException ioe) {} + } + } } }