gradle
8.6

# Directory

interface Directory : FileSystemLocation(source)

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 method or using various methods on ProjectLayout such as getProjectDirectory.

## Functions

dir
Link copied to clipboard
abstract fun dir(path: String): Directory
Returns a Directory whose location is the given path, resolved relative to this directory.
abstract fun dir(path: Provider<out CharSequence>): Provider<Directory>
Returns a Provider whose value is a Directory whose location is the given path resolved relative to this directory.
file
Link copied to clipboard
abstract fun file(path: String): RegularFile
Returns a RegularFile whose location is the given path, resolved relative to this directory.
abstract fun file(path: Provider<out CharSequence>): Provider<RegularFile>
Returns a Provider whose value is a RegularFile whose location is the given path resolved relative to this directory.
files
Link copied to clipboard
abstract fun files(paths: Array<Any>): FileCollection
Returns a FileCollection containing the given files, whose locations are the given paths resolved relative to this directory, as defined by files.
getAsFile
Link copied to clipboard
abstract fun getAsFile(): File
Returns the location of this directory, as an absolute File.
getAsFileTree
Link copied to clipboard
abstract fun getAsFileTree(): FileTree
Returns a FileTree that allows the files and directories contained in this directory to be queried.