# DirectoryInput

# DirectoryInput

```
interface DirectoryInput : QualifiedContent
```

|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [com.android.build.api.transform.DirectoryInput](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/transform/DirectoryInput#) |

A[QualifiedContent](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent)of type directory.

This means the[getFile()](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent#getFile())is the root directory containing the content.

This also contains incremental data if the transform is in incremental mode through[getChangedFiles()](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/transform/DirectoryInput#getChangedFiles()).

For a transform to run in incremental mode:

- [Transform#isIncremental()](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/transform/Transform#isIncremental())must return`true`
- The parameter isIncremental of[Transform#transform(Context, Collection, Collection, TransformOutputProvider, boolean)](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/transform/Transform#transform(com.android.build.api.transform.Context,%20kotlin.collections.MutableCollection,%20kotlin.collections.MutableCollection,%20com.android.build.api.transform.TransformOutputProvider,%20kotlin.Boolean))must be`true`.

If the transform is not in incremental mode,[getChangedFiles()](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/transform/DirectoryInput#getChangedFiles())will not contain any information (it will**not** contain the list of all the files with state[Status#NOTCHANGED](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/transform/Status).)

When a root level directory is removed, and incremental mode is on, the instance will receive a[DirectoryInput](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/transform/DirectoryInput#)instance for the removed folder, but[QualifiedContent#getFile()](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent#getFile())will return a directory that does not exist. In this case, the transform should prcess this as a removed input.

## Summary

|                                                                                                                                                                                                                                  ### Public methods                                                                                                                                                                                                                                  ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| abstract[MutableMap](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-map/index.html)\<[File](http://docs.oracle.com/javase/8/docs/api/java/io/File.html)!,[Status](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/transform/Status)!\> | [getChangedFiles](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/transform/DirectoryInput#getChangedFiles())`()` Returns the changed files. |

| ### Inherited functions ||
|---|---|
| From class[QualifiedContent](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent) |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)<[QualifiedContent.ContentType](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent.ContentType)!> | [getContentTypes](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent#getContentTypes())`()` <br /> Returns the type of content that the stream represents. Even though this may return only[DefaultContentType#RESOURCES](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent.DefaultContentType)or[DefaultContentType#CLASSES](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent.DefaultContentType), the actual content (the folder or the jar) may contain files representing other content types. This is because the transform mechanism avoids duplicating files around to remove unwanted types for performance. For each input, transforms should always take care to read and process only the files associated with the types returned by this method. <br /> | | [File](http://docs.oracle.com/javase/8/docs/api/java/io/File.html)                                                                                                                                                                                                | [getFile](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent#getFile())`()` <br /> Returns he location of the content. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                                                                                                                                                                                  | [getName](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent#getName())`()` <br /> Returns the name of the content. Can be used to differentiate different content using the same scope. This is not reliably usable at every stage of the transformations, but can be used for logging for instance. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | [MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)<in` `[QualifiedContent.Scope](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent.Scope)!>        | [getScopes](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent#getScopes())`()` <br /> Returns the scope of the content. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | ||

## Public methods

### getChangedFiles

```
@NonNull abstract fun getChangedFiles(): MutableMap<File!, Status!>
```

Returns the changed files. This is only valid if the transform is in incremental mode.