Top Description Inners Fields Constructors Methods
org.apache.tools.ant.types.resources

public Class MultiRootFileSet

extends AbstractFileSet
implements ResourceCollection
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.types.ResourceCollection, java.lang.Iterable
Imports
java.io.File, java.util.ArrayList, .Iterator, .List, org.apache.tools.ant.BuildException, .DirectoryScanner, org.apache.tools.ant.types.AbstractFileSet, .Reference, .Resource, .ResourceCollection

Union of file/dirsets that share the same patterns and selectors but have different roots.
Since
Ant 1.9.4

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
MultiRootFileSet.SetType

What to return from the set: files, directories or both.

private static class

Field Summary

Modifier and TypeField and Description
private List<File>
private boolean
private MultiRootFileSet.SetType
private Union

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addConfiguredBaseDir(final FileResource
basedir
r
)

Adds a basedir as nested element.

public Object

Returns:

the cloned MultiRootFileSet.
clone
()

Overrides org.apache.tools.ant.types.AbstractFileSet.clone.

Return a MultiRootFileSet that has the same basedirs and same patternsets as this one.
private MultiRootFileSet
public boolean

Returns:

true indicating that all elements will be FileResources.
isFilesystemOnly
()

Implements org.apache.tools.ant.types.ResourceCollection.isFilesystemOnly.

Always returns true.
public Iterator<Resource>

Returns:

an Iterator of Resources.
iterator
()

Implements java.lang.Iterable.iterator.

Fulfill the ResourceCollection contract.
private synchronized Union
public void
setBaseDirs(final String
directories as CSV
dirs
)

Adds basedirs as a comma separated list.

public synchronized void
setCache(final boolean
boolean cache flag.
b
)

Set whether to cache collections.

public void
setDir(final File
the directory's File instance.
dir
)

Overrides org.apache.tools.ant.types.AbstractFileSet.setDir.

Sets the base-directory for this instance.
public void
setRefid(final Reference
the Reference to use.
r
)

Overrides org.apache.tools.ant.types.AbstractFileSet.setRefid.

Makes this instance in effect a reference to another instance.
public void
setType(final MultiRootFileSet.SetType
the types of resources to return
type
)

Determines the types of resources to return.

private void
setup(final Union u)

public int

Returns:

number of elements as int.
size
()

Implements org.apache.tools.ant.types.ResourceCollection.size.

Fulfill the ResourceCollection contract.
public String

Returns:

a String of included directories.
toString
()

Overrides org.apache.tools.ant.types.AbstractFileSet.toString.

Returns included directories as a list of semicolon-separated paths.
Inherited from org.apache.tools.ant.types.AbstractFileSet:
addaddAndaddContainsaddContainsRegexpaddCustomaddDateaddDependaddDepthaddDifferentaddExecutableaddFilenameaddMajorityaddModifiedaddNoneaddNotaddOraddOwnedByaddPosixGroupaddPosixPermissionsaddPresentaddReadableaddSelectoraddSizeaddSymlinkaddTypeaddWritableappendExcludesappendIncludesappendSelectorcreateExcludecreateExcludesFilecreateIncludecreateIncludesFilecreatePatternSetdieOnCircularReferencegetDefaultexcludesgetDirgetDirgetDirectoryScannergetDirectoryScannergetErrorOnMissingDirgetMaxLevelsOfSymlinksgetRefgetSelectorshasPatternshasSelectorsisCaseSensitiveisFollowSymlinksmergeExcludesmergeIncludesmergePatternsselectorCountselectorElementssetCaseSensitivesetDefaultexcludessetErrorOnMissingDirsetExcludessetExcludesfilesetFilesetFollowSymlinkssetIncludessetIncludesfilesetMaxLevelsOfSymlinkssetupDirectoryScannersetupDirectoryScanner

Field Detail

baseDirsback to summary
private List<File> baseDirs
cacheback to summary
private boolean cache
typeback to summary
private MultiRootFileSet.SetType type
unionback to summary
private Union union

Constructor Detail

MultiRootFileSetback to summary
public MultiRootFileSet()

Method Detail

addConfiguredBaseDirback to summary
public void addConfiguredBaseDir(final FileResource r)

Adds a basedir as nested element.

Parameters
r:FileResource

basedir

cloneback to summary
public Object clone()

Overrides org.apache.tools.ant.types.AbstractFileSet.clone.

Return a MultiRootFileSet that has the same basedirs and same patternsets as this one.

Returns:Object

the cloned MultiRootFileSet.

Annotations
@Override
getRefback to summary
private MultiRootFileSet getRef()
isFilesystemOnlyback to summary
public boolean isFilesystemOnly()

Implements org.apache.tools.ant.types.ResourceCollection.isFilesystemOnly.

Always returns true.

Returns:boolean

true indicating that all elements will be FileResources.

Annotations
@Override
iteratorback to summary
public Iterator<Resource> iterator()

Implements java.lang.Iterable.iterator.

Fulfill the ResourceCollection contract.

Returns:Iterator<Resource>

an Iterator of Resources.

Annotations
@Override
mergeback to summary
private synchronized Union merge()
setBaseDirsback to summary
public void setBaseDirs(final String dirs)

Adds basedirs as a comma separated list.

Parameters
dirs:String

directories as CSV

setCacheback to summary
public synchronized void setCache(final boolean b)

Set whether to cache collections.

Parameters
b:boolean

boolean cache flag.

setDirback to summary
public void setDir(final File dir)

Overrides org.apache.tools.ant.types.AbstractFileSet.setDir.

Doc from org.apache.tools.ant.types.AbstractFileSet.setDir.

Sets the base-directory for this instance.

Parameters
dir:File

the directory's File instance.

Annotations
@Override
setRefidback to summary
public void setRefid(final Reference r)

Overrides org.apache.tools.ant.types.AbstractFileSet.setRefid.

Doc from org.apache.tools.ant.types.AbstractFileSet.setRefid.

Makes this instance in effect a reference to another instance.

You must not set another attribute or nest elements inside this element if you make it a reference.

Parameters
r:Reference

the Reference to use.

Annotations
@Override
setTypeback to summary
public void setType(final MultiRootFileSet.SetType type)

Determines the types of resources to return.

Parameters
type:MultiRootFileSet.SetType

the types of resources to return

setupback to summary
private void setup(final Union u)
sizeback to summary
public int size()

Implements org.apache.tools.ant.types.ResourceCollection.size.

Fulfill the ResourceCollection contract.

Returns:int

number of elements as int.

Annotations
@Override
toStringback to summary
public String toString()

Overrides org.apache.tools.ant.types.AbstractFileSet.toString.

Returns included directories as a list of semicolon-separated paths.

Returns:String

a String of included directories.

Annotations
@Override
org.apache.tools.ant.types.resources back to summary

public final Enum MultiRootFileSet.SetType

extends Enum<MultiRootFileSet.SetType>
Class Inheritance

What to return from the set: files, directories or both.

Field Summary

Modifier and TypeField and Description
public static final MultiRootFileSet.SetType
public static final MultiRootFileSet.SetType
public static final MultiRootFileSet.SetType

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static MultiRootFileSet.SetType
public static MultiRootFileSet.SetType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

bothback to summary
public static final MultiRootFileSet.SetType both
dirback to summary
public static final MultiRootFileSet.SetType dir
fileback to summary
public static final MultiRootFileSet.SetType file

Constructor Detail

SetTypeback to summary
private SetType()

Method Detail

valueOfback to summary
public static MultiRootFileSet.SetType valueOf(String name)
valuesback to summary
public static MultiRootFileSet.SetType[] values()
org.apache.tools.ant.types.resources back to summary

private Class MultiRootFileSet.Worker

extends AbstractFileSet
implements ResourceCollection
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.types.ResourceCollection, java.lang.Iterable

Field Summary

Modifier and TypeField and Description
private final MultiRootFileSet.SetType

Constructor Summary

AccessConstructor and Description
private
Worker(final MultiRootFileSet fs, final MultiRootFileSet.SetType type, final File dir)

Method Summary

Modifier and TypeMethod and Description
public boolean
isFilesystemOnly()

Implements org.apache.tools.ant.types.ResourceCollection.isFilesystemOnly.

Indicate whether this ResourceCollection is composed entirely of Resources accessible via local filesystem conventions.
public Iterator<Resource>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.
public int
size()

Implements org.apache.tools.ant.types.ResourceCollection.size.

Learn the number of contained Resources.
Inherited from org.apache.tools.ant.types.AbstractFileSet:
addaddAndaddContainsaddContainsRegexpaddCustomaddDateaddDependaddDepthaddDifferentaddExecutableaddFilenameaddMajorityaddModifiedaddNoneaddNotaddOraddOwnedByaddPosixGroupaddPosixPermissionsaddPresentaddReadableaddSelectoraddSizeaddSymlinkaddTypeaddWritableappendExcludesappendIncludesappendSelectorclonecreateExcludecreateExcludesFilecreateIncludecreateIncludesFilecreatePatternSetdieOnCircularReferencegetDefaultexcludesgetDirgetDirgetDirectoryScannergetDirectoryScannergetErrorOnMissingDirgetMaxLevelsOfSymlinksgetRefgetSelectorshasPatternshasSelectorsisCaseSensitiveisFollowSymlinksmergeExcludesmergeIncludesmergePatternsselectorCountselectorElementssetCaseSensitivesetDefaultexcludessetDirsetErrorOnMissingDirsetExcludessetExcludesfilesetFilesetFollowSymlinkssetIncludessetIncludesfilesetMaxLevelsOfSymlinkssetRefidsetupDirectoryScannersetupDirectoryScannertoString

Field Detail

typeback to summary
private final MultiRootFileSet.SetType type

Constructor Detail

Workerback to summary
private Worker(final MultiRootFileSet fs, final MultiRootFileSet.SetType type, final File dir)

Method Detail

isFilesystemOnlyback to summary
public boolean isFilesystemOnly()

Implements org.apache.tools.ant.types.ResourceCollection.isFilesystemOnly.

Doc from org.apache.tools.ant.types.ResourceCollection.isFilesystemOnly.

Indicate whether this ResourceCollection is composed entirely of Resources accessible via local filesystem conventions. If true, all resources returned from this collection should respond with a org.apache.tools.ant.types.resources.FileProvider when asked via Resource#as.

Returns:boolean

whether this is a filesystem-only resource collection.

Annotations
@Override
iteratorback to summary
public Iterator<Resource> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<Resource>

an Iterator.

Annotations
@Override
sizeback to summary
public int size()

Implements org.apache.tools.ant.types.ResourceCollection.size.

Doc from org.apache.tools.ant.types.ResourceCollection.size.

Learn the number of contained Resources.

Returns:int

number of elements as int.

Annotations
@Override