You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2009/09/16 06:19:38 UTC

svn commit: r815601 - /ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Unzip.java

Author: bodewig
Date: Wed Sep 16 04:19:38 2009
New Revision: 815601

URL: http://svn.apache.org/viewvc?rev=815601&view=rev
Log:
Close all input streams when unzipping, Submitted by David Schlosnagle, PR 42696 - merge from Ant core

Modified:
    ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Unzip.java   (contents, props changed)

Modified: ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Unzip.java
URL: http://svn.apache.org/viewvc/ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Unzip.java?rev=815601&r1=815600&r2=815601&view=diff
==============================================================================
--- ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Unzip.java (original)
+++ ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Unzip.java Wed Sep 16 04:19:38 2009
@@ -64,9 +64,15 @@
             while (e.hasMoreElements()) {
                 empty = false;
                 ZipArchiveEntry ze = (ZipArchiveEntry) e.nextElement();
-                extractFile(fileUtils, srcF, dir, zf.getInputStream(ze),
-                            ze.getName(), new Date(ze.getTime()),
-                            ze.isDirectory(), mapper);
+                InputStream is = null;
+                try {
+                    extractFile(fileUtils, srcF, dir,
+                                is = zf.getInputStream(ze),
+                                ze.getName(), new Date(ze.getTime()),
+                                ze.isDirectory(), mapper);
+                } finally {
+                    FileUtils.close(is);
+                }
             }
             if (empty && getFailOnEmptyArchive()) {
                 throw new BuildException("archive '" + srcF + "' is empty");

Propchange: ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Unzip.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 16 04:19:38 2009
@@ -0,0 +1 @@
+/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Expand.java:815599