Fixed file handle leak on version.properties

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@23193 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2010-10-18 09:21:07 +00:00
parent 043c9419dc
commit 09df474ff1

View File

@@ -19,6 +19,7 @@
package org.alfresco.repo.descriptor;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import org.alfresco.repo.descriptor.DescriptorServiceImpl.BaseDescriptor;
@@ -61,7 +62,15 @@ public class ServerDescriptorDAOImpl implements DescriptorDAO
public void setResource(final Resource descriptorResource) throws IOException
{
this.serverProperties = new Properties();
this.serverProperties.load(descriptorResource.getInputStream());
InputStream is = descriptorResource.getInputStream();
try
{
this.serverProperties.load(is);
}
finally
{
if (is != null) try { is.close(); } catch (IOException e) {}
}
}
/*