ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r372176 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/IsSigned.java
Date Wed, 25 Jan 2006 10:01:13 GMT
Author: kevj
Date: Wed Jan 25 02:00:59 2006
New Revision: 372176

URL: http://svn.apache.org/viewcvs?rev=372176&view=rev
Log:
-swap to org.apache.tools.zip instead of jdk zip
-use closeQuietly

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/IsSigned.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/IsSigned.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/IsSigned.java?rev=372176&r1=372175&r2=372176&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/IsSigned.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/IsSigned.java Wed Jan
25 02:00:59 2006
@@ -19,12 +19,12 @@
 import java.io.File;
 import java.io.IOException;
 import java.util.Enumeration;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
 
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.types.DataType;
+import org.apache.tools.zip.ZipEntry;
+import org.apache.tools.zip.ZipFile;
 
 /**
  * Checks whether a jarfile is signed: if the name of the
@@ -39,7 +39,7 @@
 
     private String name;
     private File file;
-
+    
    /**
      * The jarfile that is to be tested for the presence
      * of a signature.
@@ -72,7 +72,7 @@
         try {
             jarFile = new ZipFile(zipFile);
             if (null == name) {
-                Enumeration entries = jarFile.entries();
+                Enumeration entries = jarFile.getEntries();
                 while (entries.hasMoreElements()) {
                     String eName = ((ZipEntry) entries.nextElement()).getName();
                     if (eName.startsWith(SIG_START)
@@ -95,13 +95,7 @@
             
             return shortSig || longSig;
         } finally {
-            if (jarFile != null) {
-                try {
-                    jarFile.close();
-                } catch (IOException e) {
-                    // Ignored
-                }
-            }
+            ZipFile.closeQuietly(jarFile);
         }
     }
 



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


Mime
View raw message