Mercurial > dive4elements > gnv-client
comparison 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 |
comparison
equal
deleted
inserted
replaced
171:7fb9441dd8af | 172:b5e55f460f0b |
---|---|
88 * @throws IOException | 88 * @throws IOException |
89 */ | 89 */ |
90 private Properties getProperties(String filePath) | 90 private Properties getProperties(String filePath) |
91 throws FileNotFoundException, | 91 throws FileNotFoundException, |
92 IOException { | 92 IOException { |
93 InputStream inputStream = new FileInputStream(filePath); | 93 InputStream inputStream = null; |
94 Properties properties = new Properties(); | 94 try { |
95 properties.load(inputStream); | 95 inputStream = new FileInputStream(filePath); |
96 return properties; | 96 Properties properties = new Properties(); |
97 properties.load(inputStream); | |
98 return properties; | |
99 } | |
100 finally { | |
101 if (inputStream != null) { | |
102 try { inputStream.close(); } | |
103 catch (IOException ioe) {} | |
104 } | |
105 } | |
97 } | 106 } |
98 } | 107 } |