Author: stevel
Date: Sat Nov 1 12:49:37 2008
New Revision: 709763
URL: http://svn.apache.org/viewvc?rev=709763&view=rev
Log:
Bug 43348: add awareness of FileProvider to ZipScanner; lets us zip from other
places.
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/types/ZipScanner.java
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?rev=709763&r1=709762&r2=709763&view=diff
==============================================================================
--- 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 Sat Nov
1 12:49:37 2008
@@ -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.types.resources.FileProvider;
import org.apache.tools.zip.ZipEntry;
import org.apache.tools.zip.ZipFile;
@@ -59,19 +60,19 @@
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()) {