FileSystemLocation
@Incubating public interface Directory extends FileSystemLocation
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()
.
Modifier and Type | Method | Description |
---|---|---|
Directory |
dir(String path) |
Returns a
Directory whose location is the given path, resolved relative to this directory. |
Provider<Directory> |
dir(Provider<? extends CharSequence> path) |
|
RegularFile |
file(String path) |
Returns a
RegularFile whose location is the given path, resolved relative to this directory. |
Provider<RegularFile> |
file(Provider<? extends CharSequence> path) |
Returns a
Provider whose value is a RegularFile whose location is the given path resolved relative to this directory. |
File |
getAsFile() |
Returns the location of this directory, as an absolute
File . |
FileTree |
getAsFileTree() |
Returns a
FileTree that allows the files and directories contained in this directory to be queried. |
File getAsFile()
File
.getAsFile
in interface FileSystemLocation
FileTree getAsFileTree()
FileTree
that allows the files and directories contained in this directory to be queried.Directory dir(String path)
Directory
whose location is the given path, resolved relative to this directory.path
- The path. Can be absolute.Provider<Directory> dir(Provider<? extends CharSequence> path)
Provider
whose value is a Directory
whose location is the given path resolved relative to this directory.
The return value is live and the provided path
is queried each time the return value is queried.
path
- The path provider. Can have value that is an absolute path.RegularFile file(String path)
RegularFile
whose location is the given path, resolved relative to this directory.path
- The path. Can be absolute.Provider<RegularFile> file(Provider<? extends CharSequence> path)
Provider
whose value is a RegularFile
whose location is the given path resolved relative to this directory.
The return value is live and the provided path
is queried each time the return value is queried.
path
- The path provider. Can have value that is an absolute path.