cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r555496 - /cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/DeploymentUtil.java
Date Thu, 12 Jul 2007 05:37:32 GMT
Author: felixk
Date: Wed Jul 11 22:37:32 2007
New Revision: 555496

URL: http://svn.apache.org/viewvc?view=rev&rev=555496
Log:
Make sure, they finally are closed

Modified:
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/DeploymentUtil.java

Modified: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/DeploymentUtil.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/DeploymentUtil.java?view=diff&rev=555496&r1=555495&r2=555496
==============================================================================
--- cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/DeploymentUtil.java
(original)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/DeploymentUtil.java
Wed Jul 11 22:37:32 2007
@@ -67,11 +67,23 @@
                 final File out = new File(fileName);
                 // create directory
                 out.getParentFile().mkdirs();
-                final InputStream inStream = jarFile.getInputStream(entry);
-                final OutputStream outStream = new FileOutputStream(out);
-                IOUtils.copy(inStream, outStream);
-                inStream.close();
-                outStream.close();
+                
+                InputStream inStream = null;
+                OutputStream outStream = null;
+                try {
+                    inStream = jarFile.getInputStream(entry);
+                    outStream = new FileOutputStream(out);
+                    IOUtils.copy(inStream, outStream);
+                    inStream.close();
+                    outStream.close();
+                } finally {
+                    if (outStream != null) {
+                        outStream.close();
+                    }
+                    if (inStream != null) {
+                        inStream.close();
+                    }
+                }
             }
         }
     }



Mime
View raw message