FileSystemLocation
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(java.lang.String path) |
Returns a
Directory whose location is the given path, resolved relative to this directory. |
Provider<Directory> |
dir(Provider<? extends java.lang.CharSequence> path) |
|
RegularFile |
file(java.lang.String path) |
Returns a
RegularFile whose location is the given path, resolved relative to this directory. |
Provider<RegularFile> |
file(Provider<? extends java.lang.CharSequence> path) |
Returns a
Provider whose value is a RegularFile whose location is the given path resolved relative to this directory. |
FileCollection |
files(java.lang.Object... paths) |
Returns a
FileCollection containing the given files,
whose locations are the given paths resolved relative to this directory,
as defined by Project.files(Object...) . |
java.io.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. |
java.io.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(java.lang.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 java.lang.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(java.lang.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 java.lang.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.FileCollection files(java.lang.Object... paths)
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.paths
- The paths to the files. May be empty.