Package org.codehaus.groovy.ant

# Class FileIterator

java.lang.Object
org.codehaus.groovy.ant.FileIterator

All Implemented Interfaces:
  `Iterator<File>`

public class FileIterator extends Object implements Iterator<File>

`FileIterator` is an iterator over a number of files from a collection of FileSet instances.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FileIterator(org.apache.tools.ant.Project project, Iterator<org.apache.tools.ant.types.FileSet> fileSetIterator)`
  Creates a file iterator that yields files from the supplied file sets.
  `FileIterator(org.apache.tools.ant.Project project, Iterator<org.apache.tools.ant.types.FileSet> fileSetIterator, boolean iterateDirectories)`
  Creates a file iterator that yields files or directories from the supplied file sets.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `hasNext()`
  `File`
  `next()`
  `void`
  `remove()`
  throws UnsupportedOperationException

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface java.util.Iterator

  `forEachRemaining`

- ## Constructor Details

  - ### FileIterator

    public FileIterator(org.apache.tools.ant.Project project, Iterator<org.apache.tools.ant.types.FileSet> fileSetIterator)
    Creates a file iterator that yields files from the supplied file sets.
    Parameters:
      `project` - the Ant project used to resolve each file set
      `fileSetIterator` - the file sets to iterate

  - ### FileIterator

    public FileIterator(org.apache.tools.ant.Project project, Iterator<org.apache.tools.ant.types.FileSet> fileSetIterator, boolean iterateDirectories)
    Creates a file iterator that yields files or directories from the supplied file sets.
    Parameters:
      `project` - the Ant project used to resolve each file set
      `fileSetIterator` - the file sets to iterate
      `iterateDirectories` - `true` to iterate directories instead of files

- ## Method Details

  - ### hasNext

    public boolean hasNext()
    Specified by:
      `hasNext` in interface `Iterator<File>`
    Returns:
      true if there is another object that matches the given predicate

  - ### next

    public File next()
    Specified by:
      `next` in interface `Iterator<File>`
    Returns:
      the next object which matches the given predicate

  - ### remove

    public void remove()
    throws UnsupportedOperationException
    Specified by:
      `remove` in interface `Iterator<File>`