Class Archives

  • All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Iterable<Resource>, ResourceCollection

    public class Archives
    extends DataType
    implements ResourceCollection, java.lang.Cloneable
    A resource collection that treats all nested resources as archives and returns the contents of the archives as its content.
    Since:
    Ant 1.8.0
    • Constructor Detail

      • Archives

        public Archives()
    • Method Detail

      • createZips

        public Union createZips()
        Wrapper to identify nested resource collections as ZIP archives.
        Returns:
        Union
      • createTars

        public Union createTars()
        Wrapper to identify nested resource collections as ZIP archives.
        Returns:
        Union
      • size

        public int size()
        Sums the sizes of nested archives.
        Specified by:
        size in interface ResourceCollection
        Returns:
        int
      • iterator

        public java.util.Iterator<Resource> iterator()
        Merges the nested collections.
        Specified by:
        iterator in interface java.lang.Iterable<Resource>
        Returns:
        Iterator<Resource>
      • setRefid

        public void setRefid​(Reference r)
        Overrides the base version.
        Overrides:
        setRefid in class DataType
        Parameters:
        r - the Reference to set.
      • clone

        public java.lang.Object clone()
        Implement clone. The nested resource collections are cloned as well.
        Overrides:
        clone in class DataType
        Returns:
        a cloned instance.
      • grabArchives

        protected java.util.Iterator<ArchiveFileSet> grabArchives()
        Turns all nested resources into corresponding ArchiveFileSets and returns an iterator over the collected archives.
        Returns:
        Iterator<ArchiveFileSet>
      • configureArchive

        protected ArchiveFileSet configureArchive​(ArchiveFileSet afs,
                                                  Resource src)
        Configures the archivefileset based on this type's settings, set the source.
        Parameters:
        afs - ArchiveFileSet
        src - Resource
        Returns:
        ArchiveFileSet
      • dieOnCircularReference

        protected void dieOnCircularReference​(java.util.Stack<java.lang.Object> stk,
                                              Project p)
                                       throws BuildException
        Overrides the version of DataType to recurse on all DataType child elements that may have been added.
        Overrides:
        dieOnCircularReference in class DataType
        Parameters:
        stk - the stack of data types to use (recursively).
        p - the project to use to dereference the references.
        Throws:
        BuildException - on error.