DirSet (Apache Ant API)

Package org.apache.tools.ant.types

## Class DirSet

- java.lang.Object
- - org.apache.tools.ant.ProjectComponent
  - - org.apache.tools.ant.types.DataType
    - - org.apache.tools.ant.types.AbstractFileSet
      - - org.apache.tools.ant.types.DirSet

- All Implemented Interfaces:
    `java.lang.Cloneable`, `java.lang.Iterable<Resource>`, `ResourceCollection`, `SelectorContainer`

      public class DirSet
      extends AbstractFileSet
      implements ResourceCollection

  Subclass as hint for supporting tasks that the included directories instead of files should be used.
  Since:
    Ant 1.5

- - ### Field Summary

    - ### Fields inherited from class org.apache.tools.ant.types.DataType

      `checked, ref`

    - ### Fields inherited from class org.apache.tools.ant.ProjectComponent

      `description, location, project`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `` | `DirSet()` | Constructor for DirSet.
    `protected` | `DirSet​(DirSet dirset)` | Constructor for DirSet, with DirSet to shallowly clone.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.Object` | `clone()` | Return a DirSet that has the same basedir and same patternsets as this one.
    `protected AbstractFileSet` | `getRef​(Project p)` | Performs the check for circular references and returns the referenced FileSet.
    `boolean` | `isFilesystemOnly()` | Always returns true.
    `java.util.Iterator<Resource>` | `iterator()` | Fulfill the ResourceCollection contract.
    `int` | `size()` | Fulfill the ResourceCollection contract.
    `java.lang.String` | `toString()` | Returns included directories as a list of semicolon-separated paths.

    - ### Methods inherited from class org.apache.tools.ant.types.AbstractFileSet

      `add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addExecutable, addFilename, addMajority, addModified, addNone, addNot, addOr, addOwnedBy, addPosixGroup, addPosixPermissions, addPresent, addReadable, addSelector, addSize, addSymlink, addType, addWritable, appendExcludes, appendIncludes, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, dieOnCircularReference, getDefaultexcludes, getDir, getDir, getDirectoryScanner, getDirectoryScanner, getErrorOnMissingDir, getMaxLevelsOfSymlinks, getSelectors, hasPatterns, hasSelectors, isCaseSensitive, isFollowSymlinks, mergeExcludes, mergeIncludes, mergePatterns, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setDir, setErrorOnMissingDir, setExcludes, setExcludesfile, setFile, setFollowSymlinks, setIncludes, setIncludesfile, setMaxLevelsOfSymlinks, setRefid, setupDirectoryScanner, setupDirectoryScanner`

    - ### Methods inherited from class org.apache.tools.ant.types.DataType

      `checkAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributes`

    - ### Methods inherited from class org.apache.tools.ant.ProjectComponent

      `getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject`

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

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

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

    - ### Methods inherited from interface org.apache.tools.ant.types.ResourceCollection

      `isEmpty, stream`

- - ### Constructor Detail

    - #### DirSet

          public DirSet()

      Constructor for DirSet.

    - #### DirSet

          protected DirSet​(DirSet dirset)

      Constructor for DirSet, with DirSet to shallowly clone.
      Parameters:
        `dirset` - the dirset to clone.

  - ### Method Detail

    - #### clone

          public java.lang.Object clone()

      Return a DirSet that has the same basedir and same patternsets as this one.
      Overrides:
        `clone` in class `AbstractFileSet`
      Returns:
        the cloned dirset.

    - #### iterator

          public java.util.Iterator<Resource> iterator()

      Fulfill the ResourceCollection contract.
      Specified by:
        `iterator` in interface `java.lang.Iterable<Resource>`
      Returns:
        an Iterator of Resources.
      Since:
        Ant 1.7

    - #### size

          public int size()

      Fulfill the ResourceCollection contract.
      Specified by:
        `size` in interface `ResourceCollection`
      Returns:
        number of elements as int.
      Since:
        Ant 1.7

    - #### isFilesystemOnly

          public boolean isFilesystemOnly()

      Always returns true.
      Specified by:
        `isFilesystemOnly` in interface `ResourceCollection`
      Returns:
        true indicating that all elements will be FileResources.
      Since:
        Ant 1.7

    - #### toString

          public java.lang.String toString()

      Returns included directories as a list of semicolon-separated paths.
      Overrides:
        `toString` in class `AbstractFileSet`
      Returns:
        a `String` of included directories.

    - #### getRef

          protected AbstractFileSet getRef​(Project p)

      Description copied from class: `AbstractFileSet`
      Performs the check for circular references and returns the referenced FileSet. This method can be overridden together with `getRef()` providing implementations containing the special support for FileSet references, which can be handled by all ArchiveFileSets. NB! This method must be overridden in subclasses such as FileSet and DirSet to distinguish between the data types.
      Overrides:
        `getRef` in class `AbstractFileSet`
      Parameters:
        `p` - the current project
      Returns:
        the dereferenced object.