Author: j16sdiz
Date: 2008-08-22 08:56:08 +0000 (Fri, 22 Aug 2008)
New Revision: 22089

Modified:
   trunk/freenet/src/freenet/pluginmanager/PluginDownLoaderOfficial.java
Log:
close FileOutputStream after use

Modified: trunk/freenet/src/freenet/pluginmanager/PluginDownLoaderOfficial.java
===================================================================
--- trunk/freenet/src/freenet/pluginmanager/PluginDownLoaderOfficial.java       
2008-08-22 08:38:58 UTC (rev 22088)
+++ trunk/freenet/src/freenet/pluginmanager/PluginDownLoaderOfficial.java       
2008-08-22 08:56:08 UTC (rev 22089)
@@ -84,7 +84,12 @@
                                Certificate cert = (Certificate) it.next();
                                
ks.setCertificateEntry(cert.getPublicKey().toString(), cert);
                        }
-                       ks.store(new FileOutputStream(TMP_KEYSTORE), new 
char[0]);
+                       FileOutputStream tmpFOS = new 
FileOutputStream(TMP_KEYSTORE);
+                       try {
+                               ks.store(tmpFOS, new char[0]);
+                       } finally {
+                               Closer.close(tmpFOS);
+                       }
                        System.out.println("The CA has been imported into the 
trustStore");
                } catch(Exception e) {
                        System.err.println("Error while handling the CA :" + 
e.getMessage());


Reply via email to