You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "David H. DeWolf (JIRA)" <ji...@apache.org> on 2006/12/06 13:53:57 UTC

[jira] Resolved: (WW-1541) PropertiesSettings does not close properties files properly

     [ http://issues.apache.org/struts/browse/WW-1541?page=all ]

David H. DeWolf resolved WW-1541.
---------------------------------

    Resolution: Fixed

Done, thanks.

> PropertiesSettings does not close properties files properly
> -----------------------------------------------------------
>
>                 Key: WW-1541
>                 URL: http://issues.apache.org/struts/browse/WW-1541
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.0.1
>            Reporter: Rickard Öberg
>         Assigned To: David H. DeWolf
>             Fix For: 2.0.2
>
>
> PropertiesSettings does not close the stream to the properties file that is read. This causes redeploy issues, since the properties file cannot be removed on undeploy. Fix the constructor code like this:
> InputStream inStream = null;
>         try {
>            inStream = settingsUrl.openStream();
>             settings.load(inStream);
>         } catch (IOException e) {
>             throw new StrutsException("Could not load " + name + ".properties:" + e, e);
>         } finally
>         {
>            if (inStream != null)
>               try
>               {
>                  inStream.close();
>               } catch (IOException e)
>               {
>                  // Ignore
>               }
>         }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira