From d6cccd3f5e0038c572ee5cfa6e7402b2730c8e00 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Sat, 1 Nov 2008 19:49:37 +0000 Subject: [PATCH] Bug 43348: add awareness of FileProvider to ZipScanner; lets us zip from other places. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@709763 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/types/ZipScanner.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/org/apache/tools/ant/types/ZipScanner.java b/src/main/org/apache/tools/ant/types/ZipScanner.java index 9ea89bd99..c1cef0952 100644 --- a/src/main/org/apache/tools/ant/types/ZipScanner.java +++ b/src/main/org/apache/tools/ant/types/ZipScanner.java @@ -27,6 +27,7 @@ import java.util.zip.ZipException; 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.types.resources.FileProvider; import org.apache.tools.zip.ZipEntry; import org.apache.tools.zip.ZipFile; @@ -59,19 +60,19 @@ public class ZipScanner extends ArchiveScanner { ZipFile zf = null; File srcFile = null; - if (src instanceof FileResource) { - srcFile = ((FileResource) src).getFile(); + if (src instanceof FileProvider) { + srcFile = ((FileProvider) src).getFile(); } else { - throw new BuildException("only file resources are supported"); + throw new BuildException("Only file provider resources are supported"); } try { try { zf = new ZipFile(srcFile, encoding); } catch (ZipException ex) { - throw new BuildException("problem reading " + srcFile, ex); + throw new BuildException("Problem reading " + srcFile, ex); } catch (IOException ex) { - throw new BuildException("problem opening " + srcFile, ex); + throw new BuildException("Problem opening " + srcFile, ex); } Enumeration e = zf.getEntries(); while (e.hasMoreElements()) {