ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r801286 - /ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ZipResource.java
Date Wed, 05 Aug 2009 16:23:04 GMT
Author: bodewig
Date: Wed Aug  5 16:23:04 2009
New Revision: 801286

URL: http://svn.apache.org/viewvc?rev=801286&view=rev
Log:
support FileProvider in ZipResource

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ZipResource.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ZipResource.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ZipResource.java?rev=801286&r1=801285&r2=801286&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ZipResource.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ZipResource.java Wed Aug
 5 16:23:04 2009
@@ -74,8 +74,8 @@
      * @return the zipfile as a File.
      */
     public File getZipfile() {
-        FileResource r = (FileResource) getArchive();
-        return r.getFile();
+        FileProvider fp = (FileProvider) getArchive().as(FileProvider.class);
+        return fp.getFile();
     }
 
     /**
@@ -191,13 +191,7 @@
             log(e.getMessage(), Project.MSG_DEBUG);
             throw new BuildException(e);
         } finally {
-            if (z != null) {
-                try {
-                    z.close();
-                } catch (IOException e) {
-                    //?
-                }
-            }
+            ZipFile.closeQuietly(z);
         }
     }
 



Mime
View raw message