ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r517988 - in /ant/core/trunk/src/main/org/apache/tools/ant/types: TarScanner.java ZipScanner.java
Date Wed, 14 Mar 2007 03:45:20 GMT
Author: kevj
Date: Tue Mar 13 20:45:19 2007
New Revision: 517988

URL: http://svn.apache.org/viewvc?view=rev&rev=517988
Log:
-use quiet close methods

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/types/TarScanner.java
    ant/core/trunk/src/main/org/apache/tools/ant/types/ZipScanner.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/TarScanner.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/TarScanner.java?view=diff&rev=517988&r1=517987&r2=517988
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/TarScanner.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/TarScanner.java Tue Mar 13 20:45:19
2007
@@ -23,6 +23,7 @@
 
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.types.resources.TarResource;
+import org.apache.tools.ant.util.FileUtils;
 import org.apache.tools.tar.TarEntry;
 import org.apache.tools.tar.TarInputStream;
 
@@ -79,13 +80,7 @@
         } catch (IOException ex) {
             throw new BuildException("problem reading " + srcFile, ex);
         } finally {
-            if (ti != null) {
-                try {
-                    ti.close();
-                } catch (IOException ex) {
-                    // swallow
-                }
-            }
+            FileUtils.close(ti);
         }
     }
-}
+}
\ No newline at end of file

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/ZipScanner.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/ZipScanner.java?view=diff&rev=517988&r1=517987&r2=517988
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/ZipScanner.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/ZipScanner.java Tue Mar 13 20:45:19
2007
@@ -27,6 +27,7 @@
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.types.resources.FileResource;
 import org.apache.tools.ant.types.resources.ZipResource;
+import org.apache.tools.ant.util.FileUtils;
 import org.apache.tools.zip.ZipEntry;
 import org.apache.tools.zip.ZipFile;
 
@@ -92,13 +93,7 @@
                 }
             }
         } finally {
-            if (zf != null) {
-                try {
-                    zf.close();
-                } catch (IOException ex) {
-                    // swallow
-                }
-            }
+            ZipFile.closeQuietly(zf);
         }
     }
-}
+}
\ No newline at end of file



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


Mime
View raw message