cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r360458 - /cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java
Date Sat, 31 Dec 2005 23:14:26 GMT
Author: antonio
Date: Sat Dec 31 15:14:19 2005
New Revision: 360458

URL: http://svn.apache.org/viewcvs?rev=360458&view=rev
Log:
Close stream.

Modified:
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java?rev=360458&r1=360457&r2=360458&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java Sat
Dec 31 15:14:19 2005
@@ -689,22 +689,23 @@
                     lib.delete();
                 }
 
-                InputStream is = this.servletContext.getResourceAsStream("/WEB-INF/lib/"
+ libName);
-                if (is == null) {
-                    this.getLogger().warn("Skipping " + libName);
-                } else {
-                    this.getLogger().debug("Extracting " + libName);
-                    OutputStream os = null;
-                    try {
+                InputStream is = null;
+                OutputStream os = null;
+                try {
+                    is = this.servletContext.getResourceAsStream("/WEB-INF/lib/" + libName);
+                    if (is != null) {
+                        this.getLogger().debug("Extracting " + libName);
                         os = new FileOutputStream(lib);
                         int count;
                         while ((count = is.read(buffer)) > 0) {
                             os.write(buffer, 0, count);
                         }
-                    } finally {
-                        if (is != null) is.close();
-                        if (os != null) os.close();
+                    } else {
+                        this.getLogger().warn("Skipping " + libName);
                     }
+                } finally {
+                    if (os != null) os.close();
+                    if (is != null) is.close();
                 }
 
                 if (lastModified != -1) {
@@ -718,7 +719,6 @@
             return null;
         }
     }
-
 
     /**
      * Retreives the "extra-classpath" attribute, that needs to be



Mime
View raw message