interface FileTree : 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 org.gradle.api.Project#fileTree(java.util.Map)
, org.gradle.api.Project#zipTree(Object)
or org.gradle.api.Project#tarTree(Object)
.
abstract fun getAsFileTree(): FileTree
Returns this. |
|
abstract fun getFiles(): MutableSet<File>
Returns the contents of this tree as a flattened Set. |
|
abstract fun matching(filterConfigClosure: Closure<Any>): FileTree
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 org.gradle.api.tasks.util.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. abstract fun matching(filterConfigAction: Action<in PatternFilterable>): FileTree
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 action is used to configure the filter. A org.gradle.api.tasks.util.PatternFilterable is passed to the action. 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. abstract fun matching(patterns: PatternFilterable): FileTree
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. |
|
abstract fun plus(fileTree: FileTree): FileTree
Returns a |
|
abstract fun visit(visitor: FileVisitor): FileTree
Visits the files and directories in this file tree. Files are visited in depth-first prefix order, so that a directory is visited before its children. abstract fun visit(visitor: Closure<Any>): FileTree
Visits the files and directories in this file tree. Files are visited in depth-first prefix order, so that a directory is visited before its children. The file/directory to be visited is passed to the given closure as a abstract fun visit(visitor: Action<in FileVisitDetails>): FileTree
Visits the files and directories in this file tree. Files are visited in depth-first prefix order, so that a directory is visited before its children. The file/directory to be visited is passed to the given action as a |
abstract fun add(collection: FileCollection): FileCollection
Adds another collection to this collection. This is an optional operation. |
|
abstract fun addToAntBuilder(builder: Any, nodeName: String, type: AntType): Unit
Adds this collection to an Ant task as a nested node. The given type determines how this collection is added:
AntType#ResourceCollection , if the target Ant task supports it, as this is generally the most efficient. Using the other types may involve copying the contents of this collection to a temporary directory.
abstract fun addToAntBuilder(builder: Any, nodeName: String): Any
Adds this collection to an Ant task as a nested node. Equivalent to calling |
|
abstract fun asType(type: Class<*>): Any
Converts this collection into an object of the specified type. Supported types are: You can call this method in your build script using the |
|
abstract fun contains(file: File): Boolean
Determines whether this collection contains the given file. Generally, this method is more efficient than calling |
|
abstract fun filter(filterClosure: Closure<Any>): FileCollection
Restricts the contents of this collection to those files which match the given criteria. The filtered collection is live, so that it reflects any changes to this collection. The given closure is passed the File as a parameter, and should return a boolean value. abstract fun filter(filterSpec: Spec<in File>): FileCollection
Restricts the contents of this collection to those files which match the given criteria. The filtered collection is live, so that it reflects any changes to this collection. |
|
abstract fun getAsPath(): String
Returns the contents of this collection as a platform-specific path. This can be used, for example, in an Ant <path> element. |
|
abstract fun getSingleFile(): File
Returns the content of this collection, asserting it contains exactly one file. |
|
abstract fun isEmpty(): Boolean
Returns true if this collection is empty. Generally, calling this method is more efficient than calling |
|
abstract fun minus(collection: FileCollection): FileCollection
Returns a You can call this method in your build script using the |
|
abstract fun plus(collection: FileCollection): FileCollection
Returns a You can call this method in your build script using the |
|
abstract fun stopExecutionIfEmpty(): FileCollection
Throws a StopExecutionException if this collection is empty. |
interface ConfigurableFileTree : FileTree, DirectoryTree, PatternFilterable, Buildable
A FileTree with a single base directory, which can be configured and modified. You can obtain a |
|
interface SourceDirectorySet : FileTree, PatternFilterable, Named, Describable
A
|