From aec61d53b73d86c4db6e9a31206f8b9bbd49ad56 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Wed, 5 Aug 2009 16:23:04 +0000 Subject: [PATCH] support FileProvider in ZipResource git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@801286 13f79535-47bb-0310-9956-ffa450edef68 --- .../tools/ant/types/resources/ZipResource.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/main/org/apache/tools/ant/types/resources/ZipResource.java b/src/main/org/apache/tools/ant/types/resources/ZipResource.java index b7d9afd3b..fc196f878 100644 --- a/src/main/org/apache/tools/ant/types/resources/ZipResource.java +++ b/src/main/org/apache/tools/ant/types/resources/ZipResource.java @@ -74,8 +74,8 @@ public class ZipResource extends ArchiveResource { * @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 @@ public class ZipResource extends ArchiveResource { log(e.getMessage(), Project.MSG_DEBUG); throw new BuildException(e); } finally { - if (z != null) { - try { - z.close(); - } catch (IOException e) { - //? - } - } + ZipFile.closeQuietly(z); } }