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

public Class Files

extends AbstractSelectorContainer
implements ResourceCollection
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.types.ResourceCollection, java.lang.Iterable
Imports
java.io.File, java.util.Collections, .Iterator, .Vector, java.util.stream.Collectors, org.apache.tools.ant.BuildException, .DirectoryScanner, .Project, org.apache.tools.ant.types.PatternSet, .Reference, .Resource, .ResourceCollection, org.apache.tools.ant.types.selectors.AbstractSelectorContainer, .FileSelector

ResourceCollection implementation; like AbstractFileSet with absolute paths.
Since
Ant 1.7

Field Summary

Modifier and TypeField and Description
private Vector<PatternSet>
private boolean
private PatternSet
private DirectoryScanner
private boolean
private boolean

Constructor Summary

AccessConstructor and Description
public
Files()

Construct a new Files collection.

protected
Files(Files
the Files to use as a template.
f
)

Construct a new Files collection, shallowly cloned from the specified Files.

Method Summary

Modifier and TypeMethod and Description
public synchronized void
appendExcludes(String[]
array containing the exclude patterns.
excludes
)

Append excludes to the current list of include patterns.

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

Append includes to the current list of include patterns.

public synchronized void
public synchronized Object

Returns:

a cloned Object.
clone
()

Overrides org.apache.tools.ant.types.selectors.AbstractSelectorContainer.clone.

Create 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
()

Create a nested patternset.

private synchronized void
public synchronized boolean

Returns:

the defaultexclusions value.
getDefaultexcludes
()

Get whether default exclusions should be used or not.

protected Files

Returns:

FileCollection.
getRef
()

Hides org.apache.tools.ant.types.selectors.AbstractSelectorContainer.getRef.

Perform the check for circular references and return the referenced Files collection.
public synchronized boolean

Returns:

whether any patterns are in this container.
hasPatterns
()

Find out whether this Files collection has patterns.

private boolean
public synchronized boolean

Returns:

boolean indicating whether the Files collection is case-sensitive.
isCaseSensitive
()

Find out if this Files collection is case-sensitive.

public boolean

Returns:

true indicating that all elements of a Files collection will be FileResources.
isFilesystemOnly
()

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

Always returns true.
public synchronized Iterator<Resource>

Returns:

an Iterator of Resources.
iterator
()

Implements java.lang.Iterable.iterator.

Fulfill the ResourceCollection contract.
public String[]

Returns:

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

Get the merged exclude patterns for this Files collection.

public String[]

Returns:

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

Get the merged include patterns for this Files collection.

public synchronized PatternSet

Returns:

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

Get the merged patterns for this Files collection.

public synchronized void
setCaseSensitive(boolean
boolean.
caseSensitive
)

Set case-sensitivity of the Files collection.

public synchronized void
setDefaultexcludes(boolean
boolean.
useDefaultExcludes
)

Set whether default exclusions should be used or not.

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

Append excludes to the current list of exclude patterns.

public synchronized void
setExcludesfile(File
File instance.
excl
)

Set the File containing the excludes patterns.

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

Append includes to the current list of include patterns.

public synchronized void
setIncludesfile(File
File instance.
incl
)

Set the File containing the includes patterns.

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

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

Make this instance in effect a reference to another instance.
public synchronized int

Returns:

number of elements as int.
size
()

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

Fulfill the ResourceCollection contract.
public String

Returns:

a descriptive String.
toString
()

Overrides org.apache.tools.ant.types.selectors.AbstractSelectorContainer.toString.

Format this Files collection as a String.
Inherited from org.apache.tools.ant.types.selectors.AbstractSelectorContainer:
addaddAndaddContainsaddContainsRegexpaddCustomaddDateaddDependaddDepthaddDifferentaddExecutableaddFilenameaddMajorityaddModifiedaddNoneaddNotaddOraddOwnedByaddPosixGroupaddPosixPermissionsaddPresentaddReadableaddSelectoraddSizeaddSymlinkaddTypeaddWritabledieOnCircularReferencegetSelectorshasSelectorsselectorCountselectorElementsvalidate

Field Detail

additionalPatternsback to summary
private Vector<PatternSet> additionalPatterns
caseSensitiveback to summary
private boolean caseSensitive
defaultPatternsback to summary
private PatternSet defaultPatterns
dsback to summary
private DirectoryScanner ds
useDefaultExcludesback to summary
private boolean useDefaultExcludes

Constructor Detail

Filesback to summary
public Files()

Construct a new Files collection.

Filesback to summary
protected Files(Files f)

Construct a new Files collection, shallowly cloned from the specified Files.

Parameters
f:Files

the Files to use as a template.

Method Detail

appendExcludesback to summary
public synchronized void appendExcludes(String[] excludes)

Append excludes to the current list of include patterns.

Parameters
excludes:String[]

array containing the exclude patterns.

appendIncludesback to summary
public synchronized void appendIncludes(String[] includes)

Append includes to the current list of include patterns.

Parameters
includes:String[]

array containing the include patterns.

appendSelectorback to summary
public synchronized void appendSelector(FileSelector selector)

Overrides org.apache.tools.ant.types.selectors.AbstractSelectorContainer.appendSelector.

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

Add a new selector into this container.

Parameters
selector:FileSelector

the new FileSelector to add.

Annotations
@Override
cloneback to summary
public synchronized Object clone()

Overrides org.apache.tools.ant.types.selectors.AbstractSelectorContainer.clone.

Create a deep clone of this instance, except for the nested selectors (the list of selectors is a shallow clone of this instance's list).

Returns:Object

a cloned Object.

Annotations
@Override
createExcludeback to summary
public synchronized PatternSet.NameEntry createExclude()

Add a name entry to the exclude list.

Returns:PatternSet.NameEntry

PatternSet.NameEntry.

createExcludesFileback to summary
public synchronized PatternSet.NameEntry createExcludesFile()

Add a name entry to the excludes files list.

Returns:PatternSet.NameEntry

PatternSet.PatternFileNameEntry.

createIncludeback to summary
public synchronized PatternSet.NameEntry createInclude()

Add a name entry to the include list.

Returns:PatternSet.NameEntry

PatternSet.NameEntry.

createIncludesFileback to summary
public synchronized PatternSet.NameEntry createIncludesFile()

Add a name entry to the include files list.

Returns:PatternSet.NameEntry

PatternSet.PatternFileNameEntry.

createPatternSetback to summary
public synchronized PatternSet createPatternSet()

Create a nested patternset.

Returns:PatternSet

PatternSet.

ensureDirectoryScannerSetupback to summary
private synchronized void ensureDirectoryScannerSetup()
getDefaultexcludesback to summary
public synchronized boolean getDefaultexcludes()

Get whether default exclusions should be used or not.

Returns:boolean

the defaultexclusions value.

getRefback to summary
protected Files getRef()

Hides org.apache.tools.ant.types.selectors.AbstractSelectorContainer.getRef.

Perform the check for circular references and return the referenced Files collection.

Returns:Files

FileCollection.

hasPatternsback to summary
public synchronized boolean hasPatterns()

Find out whether this Files collection has patterns.

Returns:boolean

whether any patterns are in this container.

hasPatternsback to summary
private boolean hasPatterns(PatternSet ps)
isCaseSensitiveback to summary
public synchronized boolean isCaseSensitive()

Find out if this Files collection is case-sensitive.

Returns:boolean

boolean indicating whether the Files collection is case-sensitive.

isFilesystemOnlyback to summary
public boolean isFilesystemOnly()

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

Always returns true.

Returns:boolean

true indicating that all elements of a Files collection will be FileResources.

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

Implements java.lang.Iterable.iterator.

Fulfill the ResourceCollection contract.

Returns:Iterator<Resource>

an Iterator of Resources.

Annotations
@Override
mergeExcludesback to summary
public String[] mergeExcludes(Project p)

Get the merged exclude patterns for this Files collection.

Parameters
p:Project

Project instance.

Returns:String[]

the exclude patterns of the default pattern set and all nested patternsets.

mergeIncludesback to summary
public String[] mergeIncludes(Project p)

Get the merged include patterns for this Files collection.

Parameters
p:Project

Project instance.

Returns:String[]

the include patterns of the default pattern set and all nested patternsets.

mergePatternsback to summary
public synchronized PatternSet mergePatterns(Project p)

Get the merged patterns for this Files collection.

Parameters
p:Project

Project instance.

Returns:PatternSet

the default patternset merged with the additional sets in a new PatternSet instance.

setCaseSensitiveback to summary
public synchronized void setCaseSensitive(boolean caseSensitive)

Set case-sensitivity of the Files collection.

Parameters
caseSensitive:boolean

boolean.

setDefaultexcludesback to summary
public synchronized void setDefaultexcludes(boolean useDefaultExcludes)

Set whether default exclusions should be used or not.

Parameters
useDefaultExcludes:boolean

boolean.

setExcludesback to summary
public synchronized void setExcludes(String excludes)

Append excludes to the current list of exclude patterns.

Patterns may be separated by a comma or a space.

Parameters
excludes:String

the String containing the exclude patterns.

setExcludesfileback to summary
public synchronized void setExcludesfile(File excl) throws BuildException

Set the File containing the excludes patterns.

Parameters
excl:File

File instance.

Exceptions
BuildException:
if there is a problem.
setIncludesback to summary
public synchronized void setIncludes(String includes)

Append includes to the current list of include patterns.

Patterns may be separated by a comma or a space.

Parameters
includes:String

the String containing the include patterns.

setIncludesfileback to summary
public synchronized void setIncludesfile(File incl) throws BuildException

Set the File containing the includes patterns.

Parameters
incl:File

File instance.

Exceptions
BuildException:
if there is a problem.
setRefidback to summary
public void setRefid(Reference r) throws BuildException

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

Make 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
Exceptions
BuildException:
if there is a problem.
sizeback to summary
public synchronized 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.selectors.AbstractSelectorContainer.toString.

Format this Files collection as a String.

Returns:String

a descriptive String.

Annotations
@Override