Author: bodewig
Date: Thu Nov 27 21:37:17 2008
New Revision: 721344
URL: http://svn.apache.org/viewvc?rev=721344&view=rev
Log:
Initial version of a resource collection that extracts archives nested as
resources. PR 46257.
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/types/defaults.properties
ant/core/trunk/src/main/org/apache/tools/ant/util/CollectionUtils.java
Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/defaults.properties
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/defaults.properties?rev=721344&r1=721343&r2=721344&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/defaults.properties
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/defaults.properties Thu
Nov 27 21:37:17 2008
@@ -75,6 +75,7 @@
tarfileset=org.apache.tools.ant.types.TarFileSet
tokens=org.apache.tools.ant.types.resources.Tokens
mappedresources=org.apache.tools.ant.types.resources.MappedResourceCollection
+archives=org.apache.tools.ant.types.resources.Archives
#Resources (single-element ResourceCollections):
resource=org.apache.tools.ant.types.Resource
Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/CollectionUtils.java
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/CollectionUtils.java?rev=721344&r1=721343&r2=721344&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/CollectionUtils.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/CollectionUtils.java Thu
Nov 27 21:37:17 2008
@@ -208,6 +208,19 @@
};
}
+ /**
+ * Returns a collection containg all elements of the iterator.
+ *
+ * @since Ant 1.8.0
+ */
+ public static Collection asCollection(final Iterator iter) {
+ List l = new ArrayList();
+ while (iter.hasNext()) {
+ l.add(iter.next());
+ }
+ return l;
+ }
+
private static final class CompoundEnumeration implements Enumeration {
private final Enumeration e1, e2;