org.gradle.api.file

## Interface DirectoryProperty

- All Superinterfaces:
    Property<Directory>, Provider<Directory>
  All Known Subinterfaces:
    DirectoryVar

      @Incubating
      public interface DirectoryProperty
      extends Provider<Directory>, Property<Directory>

  Represents some configurable directory location, whose value is mutable and is not necessarily currently known until later.

  Note: This interface is not intended for implementation by build script or plugin authors. An instance of this class can be created using the `ProjectLayout.directoryProperty()` method.

  Since:
    4.3

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Provider<Directory>` | `dir(Provider<? extends CharSequence> path)` Returns a `Directory` whose value is the given path resolved relative to the value of this directory.
    `Provider<Directory>` | `dir(String path)` Returns a `Directory` whose value is the given path resolved relative to the value of this directory.
    `Provider<RegularFile>` | `file(Provider<? extends CharSequence> path)` Returns a `RegularFile` whose value is the given path resolved relative to the value of this directory.
    `Provider<RegularFile>` | `file(String path)` Returns a `RegularFile` whose value is the given path resolved relative to the value of this directory.
    `Provider<File>` | `getAsFile()` Views the location of this directory as a `File`.
    `FileTree` | `getAsFileTree()` Returns a `FileTree` that allows the files and directories contained in this directory to be queried.
    `void` | `set(File dir)` Sets the location of this directory.

    - ### Methods inherited from interface org.gradle.api.provider.Property

      `set, set`

    - ### Methods inherited from interface org.gradle.api.provider.Provider

      `get, getOrElse, getOrNull, isPresent, map`

- - ### Method Detail

    - #### getAsFile

          Provider<File> getAsFile()

      Views the location of this directory as a `File`.

    - #### getAsFileTree

          FileTree getAsFileTree()

      Returns a `FileTree` that allows the files and directories contained in this directory to be queried.

    - #### set

          void set(File dir)

      Sets the location of this directory.

    - #### dir

          Provider<Directory> dir(String path)

      Returns a `Directory` whose value is the given path resolved relative to the value of this directory.
      Parameters:
        `path` - The path. Can be absolute.
      Returns:
        The directory.

    - #### dir

          Provider<Directory> dir(Provider<? extends CharSequence> path)

      Returns a `Directory` whose value is the given path resolved relative to the value of this directory.
      Parameters:
        `path` - The path. Can have a value that is an absolute path.
      Returns:
        The directory.

    - #### file

          Provider<RegularFile> file(String path)

      Returns a `RegularFile` whose value is the given path resolved relative to the value of this directory.
      Parameters:
        `path` - The path. Can be absolute.
      Returns:
        The file.

    - #### file

          Provider<RegularFile> file(Provider<? extends CharSequence> path)

      Returns a `RegularFile` whose value is the given path resolved relative to the value of this directory.
      Parameters:
        `path` - The path. Can have a value that is an absolute path.
      Returns:
        The file.