click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bck...@apache.org
Subject svn commit: r986278 - /click/trunk/click/framework/src/org/apache/click/service/DeployUtils.java
Date Tue, 17 Aug 2010 11:56:39 GMT
Author: bckfnn
Date: Tue Aug 17 11:56:38 2010
New Revision: 986278

URL: http://svn.apache.org/viewvc?rev=986278&view=rev
Log:
close input stream and readers. check return value from read.


Modified:
    click/trunk/click/framework/src/org/apache/click/service/DeployUtils.java

Modified: click/trunk/click/framework/src/org/apache/click/service/DeployUtils.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/service/DeployUtils.java?rev=986278&r1=986277&r2=986278&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/service/DeployUtils.java (original)
+++ click/trunk/click/framework/src/org/apache/click/service/DeployUtils.java Tue Aug 17 11:56:38
2010
@@ -230,6 +230,7 @@ class DeployUtils<T> {
                                 children.add(entry.getName());
                             }
                         }
+                        jarInput.close();
                     } else {
                         // Some servlet containers allow reading from "directory"
                         // resources like text file, listing the child resources
@@ -255,6 +256,7 @@ class DeployUtils<T> {
                                     children.add(line);
                                 }
                             }
+                            reader.close();
                         }
                     }
 
@@ -472,7 +474,9 @@ class DeployUtils<T> {
         InputStream is = null;
         try {
             is = url.openStream();
-            is.read(buffer, 0, JAR_MAGIC.length);
+            if (is.read(buffer, 0, JAR_MAGIC.length) != JAR_MAGIC.length) {
+                return false;
+            }
             if (Arrays.equals(buffer, JAR_MAGIC)) {
                 if (logService.isInfoEnabled()) {
                     logService.info("found jar: " + url);



Mime
View raw message