cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r555380 - /cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/DeploymentUtil.java
Date Wed, 11 Jul 2007 19:53:56 GMT
Author: felixk
Date: Wed Jul 11 12:53:55 2007
New Revision: 555380

URL: http://svn.apache.org/viewvc?view=rev&rev=555380
Log:
Closed the streams again after having them opened. This fixes running out of filehandles (Too
many open files) when having a lot of dependencies (e.g.running cocoon-webapp with -Pallblocks).

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=555380&r1=555379&r2=555380
==============================================================================
--- 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 12:53:55 2007
@@ -19,6 +19,8 @@
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.net.JarURLConnection;
 import java.net.URL;
 import java.util.Enumeration;
@@ -65,7 +67,11 @@
                 final File out = new File(fileName);
                 // create directory
                 out.getParentFile().mkdirs();
-                IOUtils.copy(jarFile.getInputStream(entry), new FileOutputStream(out));
+                final InputStream inStream = jarFile.getInputStream(entry);
+                final OutputStream outStream = new FileOutputStream(out);
+                IOUtils.copy(inStream, outStream);
+                inStream.close();
+                outStream.close();
             }
         }
     }



Mime
View raw message