public interface FileTree extends FileCollection
A FileTree
represents a hierarchy of files. It extends FileCollection
to add hierarchy query and
manipulation methods. You typically use a FileTree
to represent files to copy or the contents of an
archive.
You can obtain a FileTree
instance using Project.fileTree(java.util.Map)
,
Project.zipTree(Object)
or Project.tarTree(Object)
.
FileCollection.AntType
Modifier and Type | Method and Description |
---|---|
FileTree |
getAsFileTree()
Returns this.
|
FileTree |
matching(Closure filterConfigClosure)
Restricts the contents of this tree to those files matching the given filter.
|
FileTree |
matching(PatternFilterable patterns)
Restricts the contents of this tree to those files matching the given filter.
|
FileTree |
plus(FileTree fileTree)
Returns a
FileTree which contains the union of this tree and the given tree. |
FileTree |
visit(Closure visitor)
Visits the files and directories in this file tree.
|
FileTree |
visit(FileVisitor visitor)
Visits the files and directories in this file tree.
|
add, addToAntBuilder, addToAntBuilder, asType, contains, filter, filter, getAsPath, getFiles, getSingleFile, isEmpty, minus, plus, stopExecutionIfEmpty
getBuildDependencies
FileTree matching(Closure filterConfigClosure)
Restricts the contents of this tree to those files matching the given filter. The filtered tree is live, so that any changes to this tree are reflected in the filtered tree.
The given closure is used to configure the filter. A PatternFilterable
is
passed to the closure as its delegate. Only files which match the specified include patterns will be included in
the filtered tree. Any files which match the specified exclude patterns will be excluded from the filtered
tree.
filterConfigClosure
- the closure to use to configure the filter.FileTree matching(PatternFilterable patterns)
Restricts the contents of this tree to those files matching the given filter. The filtered tree is live, so that any changes to this tree are reflected in the filtered tree.
The given pattern set is used to configure the filter. Only files which match the specified include patterns will be included in the filtered tree. Any files which match the specified exclude patterns will be excluded from the filtered tree.
patterns
- the pattern set to use to configure the filter.FileTree visit(FileVisitor visitor)
visitor
- The visitor.FileTree visit(Closure visitor)
FileVisitDetails
visitor
- The visitor.FileTree plus(FileTree fileTree)
FileTree
which contains the union of this tree and the given tree. The returned tree is live,
so that changes to either this tree or the other source tree are reflected in the returned tree.fileTree
- The tree. Should not be null.FileTree getAsFileTree()
getAsFileTree
in interface FileCollection