Directory (Gradle API 8.14) (original) (raw)
All Superinterfaces:
[FileSystemLocation](FileSystemLocation.html "interface in org.gradle.api.file")
Represents a directory at some fixed location on the file system.
Note: This interface is not intended for implementation by build script or plugin authors. An instance of this class can be created using the dir(String) method or using various methods on ProjectLayout such as ProjectLayout.getProjectDirectory().
Since:
4.1
Method Summary
Returns a Directory whose location is the given path, resolved relative to this directory.
Returns a Provider whose value is a Directory whose location is the given path resolved relative to this directory.
Returns a RegularFile whose location is the given path, resolved relative to this directory.
Returns a Provider whose value is a RegularFile whose location is the given path resolved relative to this directory.[getAsFile](#getAsFile%28%29)()
Returns the location of this directory, as an absolute File.
Returns a FileTree that allows the files and directories contained in this directory to be queried.
Method Details
getAsFile
Returns the location of this directory, as an absolute File.
Specified by:
[getAsFile](FileSystemLocation.html#getAsFile%28%29)
in interface[FileSystemLocation](FileSystemLocation.html "interface in org.gradle.api.file")
Returns:
the File
Since:
4.2getAsFileTree
Returns a FileTree that allows the files and directories contained in this directory to be queried.
dir
Returns a Directory whose location is the given path, resolved relative to this directory.
Parameters:
path
- The path. Can be absolute.
Returns:
The directory.dir
Returns a Provider whose value is a Directory whose location is the given path resolved relative to this directory.
The return value is live and the providedpath
is queried each time the return value is queried.
Parameters:
path
- The path provider. Can have value that is an absolute path.
Returns:
The provider.file
Returns a RegularFile whose location is the given path, resolved relative to this directory.
Parameters:
path
- The path. Can be absolute.
Returns:
The file.file
Returns a Provider whose value is a RegularFile whose location is the given path resolved relative to this directory.
The return value is live and the providedpath
is queried each time the return value is queried.
Parameters:
path
- The path provider. Can have value that is an absolute path.
Returns:
The file.files
Returns a FileCollection containing the given files, whose locations are the given paths resolved relative to this directory, as defined by Project.files(Object...). This method can also be used to create an empty collection, but the collection may not be mutated later.
Parameters:
paths
- The paths to the files. May be empty.
Returns:
The file collection.
Since:
6.0