tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r883562 - /tomcat/trunk/java/org/apache/catalina/util/ExtensionValidator.java
Date Tue, 24 Nov 2009 01:15:21 GMT
Author: markt
Date: Tue Nov 24 01:15:19 2009
New Revision: 883562

URL: http://svn.apache.org/viewvc?rev=883562&view=rev
Log:
Explicitly close the stream.

Modified:
    tomcat/trunk/java/org/apache/catalina/util/ExtensionValidator.java

Modified: tomcat/trunk/java/org/apache/catalina/util/ExtensionValidator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/util/ExtensionValidator.java?rev=883562&r1=883561&r2=883562&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/util/ExtensionValidator.java (original)
+++ tomcat/trunk/java/org/apache/catalina/util/ExtensionValidator.java Tue Nov 24 01:15:19
2009
@@ -188,7 +188,8 @@
                     continue;
                 }
                 Resource resource = (Resource) obj;
-                Manifest jmanifest = getManifest(resource.streamContent());
+                inputStream = resource.streamContent();
+                Manifest jmanifest = getManifest(inputStream);
                 if (jmanifest != null) {
                     ManifestResource mre = new ManifestResource(
                                                 binding.getName(),
@@ -200,6 +201,14 @@
         } catch (NamingException nex) {
             // Jump out of the check for this application because it 
             // has no resources
+        } finally {
+            if (inputStream != null) {
+                try {
+                    inputStream.close();
+                } catch (Throwable t) {
+                    // Ignore
+                }
+            }
         }
 
         return validateManifestResources(appName, appManifestResources);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message