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

public abstract Class AbstractFileSet

extends DataType
implements Cloneable, SelectorContainer
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.types.selectors.SelectorContainer, java.lang.Cloneable
Known Direct Subclasses
org.apache.tools.ant.types.DirSet, org.apache.tools.ant.types.resources.MultiRootFileSet, org.apache.tools.ant.types.resources.MultiRootFileSet.Worker, org.apache.tools.ant.taskdefs.Sync.SyncTarget, org.apache.tools.ant.types.FileSet
Imports
java.io.File, java.util.ArrayList, .Collections, .Enumeration, .List, .Stack, java.util.stream.Collectors, org.apache.tools.ant.BuildException, .DirectoryScanner, .FileScanner, .Project, org.apache.tools.ant.types.selectors.AndSelector, .ContainsRegexpSelector, .ContainsSelector, .DateSelector, .DependSelector, .DepthSelector, .DifferentSelector, .ExecutableSelector, .ExtendSelector, .FileSelector, .FilenameSelector, .MajoritySelector, .NoneSelector, .NotSelector, .OrSelector, .OwnedBySelector, .PosixGroupSelector, .PosixPermissionsSelector, .PresentSelector, .ReadableSelector, .SelectSelector, .SelectorContainer, .SelectorScanner, .SizeSelector, .SymlinkSelector, .TypeSelector, .WritableSelector, org.apache.tools.ant.types.selectors.modifiedselector.ModifiedSelector

Class that holds an implicit patternset and supports nested patternsets and creates a DirectoryScanner using these patterns.

Common base class for DirSet and FileSet.

Field Summary

Modifier and TypeField and Description
private List<PatternSet>
private boolean
private PatternSet
private File
private DirectoryScanner
private boolean
private boolean
private boolean
private int
private List<FileSelector>
private boolean
Inherited from org.apache.tools.ant.types.DataType:
checkedref

Constructor Summary

AccessConstructor and Description
public
AbstractFileSet()

Construct a new AbstractFileSet.

protected
AbstractFileSet(AbstractFileSet
the AbstractFileSet to use as a template.
fileset
)

Construct a new AbstractFileSet, shallowly cloned from the specified AbstractFileSet.

Method Summary

Modifier and TypeMethod and Description
public void
add(FileSelector
the FileSelector to add.
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.add.

Add an arbitrary selector.
public void
addAnd(AndSelector
the AndSelector to add.
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addAnd.

Add an "And" selector entry on the selector list.
public void
addContains(ContainsSelector
the ContainsSelector to add.
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addContains.

Add a contains selector entry on the selector list.
public void
addContainsRegexp(ContainsRegexpSelector
the ContainsRegexpSelector to add.
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addContainsRegexp.

Add a regular expression selector entry on the selector list.
public void
addCustom(ExtendSelector
the ExtendSelector to add.
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addCustom.

Add an extended selector entry on the selector list.
public void
addDate(DateSelector
the DateSelector to add.
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addDate.

Add a selector date entry on the selector list.
public void
addDepend(DependSelector
the DependSelector to add.
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addDepend.

Add a depends selector entry on the selector list.
public void
addDepth(DepthSelector
the DepthSelector to add.
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addDepth.

Add a depth selector entry on the selector list.
public void
addDifferent(DifferentSelector
the DifferentSelector to add.
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addDifferent.

Add a DifferentSelector entry on the selector list.
public void
addExecutable(ExecutableSelector
ExecutableSelector
e
)

public void
addFilename(FilenameSelector
the FilenameSelector to add.
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addFilename.

Add a selector filename entry on the selector list.
public void
addMajority(MajoritySelector
the MajoritySelector to add.
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addMajority.

Add a majority selector entry on the selector list.
public void
addModified(ModifiedSelector
the ModifiedSelector to add.
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addModified.

Add the modified selector.
public void
addNone(NoneSelector
the NoneSelector to add.
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addNone.

Add a "None" selector entry on the selector list.
public void
addNot(NotSelector
the NotSelector to add.
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addNot.

Add a "Not" selector entry on the selector list.
public void
addOr(OrSelector
the OrSelector to add.
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addOr.

Add an "Or" selector entry on the selector list.
public void
addOwnedBy(OwnedBySelector
OwnedBySelector
o
)

public void
addPosixGroup(PosixGroupSelector
PosixGroupSelector
o
)

public void
addPosixPermissions(PosixPermissionsSelector
PosixPermissionsSelector
o
)

public void
addPresent(PresentSelector
the PresentSelector to add.
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addPresent.

Add a present selector entry on the selector list.
public void
public void
addSelector(SelectSelector
the SelectSelector to add.
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addSelector.

Add a "Select" selector entry on the selector list.
public void
addSize(SizeSelector
the SizeSelector to add.
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addSize.

Add a selector size entry on the selector list.
public void
addType(TypeSelector
the TypeSelector to add.
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addType.

Add a selector type entry on the selector list.
public void
public synchronized void
appendExcludes(String[]
array containing the exclude patterns.
excludes
)

Appends excludes to the current list of exclude patterns.

public synchronized void
appendIncludes(String[]
array containing the include patterns.
includes
)

Appends includes to the current list of include patterns.

public synchronized void
appendSelector(FileSelector
the new FileSelector to add.
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.appendSelector.

Add a new selector into this container.
public synchronized Object

Returns:

the cloned object
clone
()

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

Creates a deep clone of this instance, except for the nested selectors (the list of selectors is a shallow clone of this instance's list).
public synchronized PatternSet.NameEntry

Returns:

PatternSet.NameEntry.
createExclude
()

Add a name entry to the exclude list.

public synchronized PatternSet.NameEntry

Returns:

PatternSet.PatternFileNameEntry.
createExcludesFile
()

Add a name entry to the excludes files list.

public synchronized PatternSet.NameEntry

Returns:

PatternSet.NameEntry.
createInclude
()

Add a name entry to the include list.

public synchronized PatternSet.NameEntry

Returns:

PatternSet.PatternFileNameEntry.
createIncludesFile
()

Add a name entry to the include files list.

public synchronized PatternSet

Returns:

PatternSet.
createPatternSet
()

Creates a nested patternset.

protected synchronized void
dieOnCircularReference(Stack<Object>
the stack of references to check.
stk
,
Project
the project to use to dereference the references.
p
)

Overrides org.apache.tools.ant.types.DataType.dieOnCircularReference.

Check to see whether any DataType we hold references to is included in the Stack (which holds all DataType instances that directly or indirectly reference this instance, including this instance itself).
private BuildException
public synchronized boolean

Returns:

the default exclusions value.
getDefaultexcludes
()

Whether default exclusions should be used or not.

public File

Returns:

File.
getDir
()

Retrieves the base-directory for this instance.

public synchronized File

Returns:

File.
getDir
(Project
the Project against which the reference is resolved, if set.
p
)

Retrieves the base-directory for this instance.

public DirectoryScanner

Returns:

a DirectoryScanner instance.
getDirectoryScanner
()

Returns the directory scanner needed to access the files to process.

public DirectoryScanner

Returns:

a DirectoryScanner instance.
getDirectoryScanner
(Project
the Project against which the DirectoryScanner should be configured.
p
)

Returns the directory scanner needed to access the files to process.

public boolean

Returns:

boolean
getErrorOnMissingDir
()

Gets whether an error is/should be thrown if the base directory does not exist.

protected AbstractFileSet

Returns:

the dereferenced object.
getRef
(Project
the current project
p
)

Performs the check for circular references and returns the referenced FileSet.

public synchronized FileSelector[]

Returns:

a FileSelector[] of the selectors in this container.
getSelectors
(Project
the current project
p
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.getSelectors.

Returns the set of selectors as an array.
public synchronized boolean

Returns:

whether any patterns are in this container.
hasPatterns
()

Indicates whether there are any patterns here.

public synchronized boolean

Returns:

whether any selectors are in this container.
hasSelectors
()

Implements org.apache.tools.ant.types.selectors.SelectorContainer.hasSelectors.

Indicates whether there are any selectors here.
public synchronized boolean

Returns:

boolean indicating whether the fileset is case sensitive.
isCaseSensitive
()

Find out if the fileset is case sensitive.

public String[]

Returns:

the exclude patterns of the default pattern set and all nested patternsets.
mergeExcludes
(Project
the project to use.
p
)

Get the merged exclude patterns for this AbstractFileSet.

public String[]

Returns:

the include patterns of the default pattern set and all nested patternsets.
mergeIncludes
(Project
the project to use.
p
)

Get the merged include patterns for this AbstractFileSet.

public synchronized PatternSet

Returns:

the default patternset merged with the additional sets in a new PatternSet instance.
mergePatterns
(Project
the project to use.
p
)

Get the merged patterns for this AbstractFileSet.

public synchronized int

Returns:

the number of selectors in this container as an int.
selectorCount
()

Implements org.apache.tools.ant.types.selectors.SelectorContainer.selectorCount.

Gives the count of the number of selectors in this container.
public synchronized Enumeration<FileSelector>

Returns:

an Enumeration of selectors.
selectorElements
()

Implements org.apache.tools.ant.types.selectors.SelectorContainer.selectorElements.

Returns an enumerator for accessing the set of selectors.
public synchronized void
setCaseSensitive(boolean
boolean.
caseSensitive
)

Sets case sensitivity of the file system.

public synchronized void
setDefaultexcludes(boolean
boolean.
useDefaultExcludes
)

Sets whether default exclusions should be used or not.

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

Sets the base-directory for this instance.

public void
setErrorOnMissingDir(boolean
true if missing directories cause errors, false if not.
errorOnMissingDir
)

Sets whether an error is thrown if a directory does not exist.

public synchronized void
setExcludes(String
the String containing the exclude patterns.
excludes
)

Appends excludes to the current list of exclude patterns.

public synchronized void
setExcludesfile(File
File instance.
excl
)

Sets the File containing the excludes patterns.

public synchronized void
setFile(File
the single File included in this AbstractFileSet.
file
)

Creates a single file fileset.

public synchronized void
setIncludes(String
the String containing the include patterns.
includes
)

Appends includes to the current list of include patterns.

public synchronized void
setIncludesfile(File
File instance.
incl
)

Sets the File containing the includes patterns.

public void
setRefid(Reference
the Reference to use.
r
)

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

Makes this instance in effect a reference to another instance.
public void
setupDirectoryScanner(FileScanner
a FileScanner instance.
ds
)

Set up the specified directory scanner against this AbstractFileSet's Project.

public synchronized void
setupDirectoryScanner(FileScanner
a FileScanner instance.
ds
,
Project
an Ant Project instance.
p
)

Set up the specified directory scanner against the specified project.

public String

Returns:

a String of included filenames.
toString
()

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

Returns included files as a list of semicolon-separated filenames.
Inherited from org.apache.tools.ant.types.DataType:
checkAttributesAllowedcheckChildrenAllowedcircularReferencedieOnCircularReferencedieOnCircularReferencegetCheckedRefgetCheckedRefgetCheckedRefgetCheckedRefgetCheckedRefgetDataTypeNamegetRefidinvokeCircularReferenceCheckisCheckedisReferencenoChildrenAllowedpushAndInvokeCircularReferenceChecksetCheckedtooManyAttributes