The parameter isIncremental of transform must be true.
If the transform is not in incremental mode, getChangedFiles will not contain any information (it will not contain the list of all the files with state NOTCHANGED.)
When a root level directory is removed, and incremental mode is on, the instance will receive a DirectoryInput instance for the removed folder, but getFile will return a directory that does not exist. In this case, the transform should prcess this as a removed input.
Returns the changed files. This is only valid if the transform is in incremental mode.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# DirectoryInput\n==============\n\n\n```\ninterface DirectoryInput : QualifiedContent\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n| **This interface is deprecated.** \n\nA [QualifiedContent](/reference/tools/gradle-api/7.2/com/android/build/api/transform/QualifiedContent) of type directory.\n\nThis means the [getFile](/reference/tools/gradle-api/7.2/com/android/build/api/transform/QualifiedContent#getFile()) is the root directory containing the content.\n\nThis also contains incremental data if the transform is in incremental mode through [getChangedFiles](/reference/tools/gradle-api/7.2/com/android/build/api/transform/DirectoryInput#getChangedFiles()).\n\nFor a transform to run in incremental mode:\n\n- [isIncremental](/reference/tools/gradle-api/7.2/com/android/build/api/transform/Transform#isIncremental()) must return `true`\n- The parameter isIncremental of [transform](/reference/tools/gradle-api/7.2/com/android/build/api/transform/Transform#transform(com.android.build.api.transform.Context,java.util.Collection\u003ccom.android.build.api.transform.TransformInput\u003e,java.util.Collection\u003ccom.android.build.api.transform.TransformInput\u003e,com.android.build.api.transform.TransformOutputProvider,boolean)) must be `true`.\n\nIf the transform is not in incremental mode, [getChangedFiles](/reference/tools/gradle-api/7.2/com/android/build/api/transform/DirectoryInput#getChangedFiles()) will not contain any information (it will **not** contain the list of all the files with state NOTCHANGED.)\n\nWhen a root level directory is removed, and incremental mode is on, the instance will receive a [DirectoryInput](/reference/tools/gradle-api/7.2/com/android/build/api/transform/DirectoryInput) instance for the removed folder, but [getFile](/reference/tools/gradle-api/7.2/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.\n\nSummary\n-------\n\n| ### Public functions ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Map](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)`\u003c`[File](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/File.html)`?, `[Status](/reference/tools/gradle-api/7.2/com/android/build/api/transform/Status)`?\u003e` | [getChangedFiles](/reference/tools/gradle-api/7.2/com/android/build/api/transform/DirectoryInput#getChangedFiles())`()` Returns the changed files. |\n\n| ### Inherited functions ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| From class [QualifiedContent](/reference/tools/gradle-api/7.2/com/android/build/api/transform/QualifiedContent) |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Set](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`\u003c`[QualifiedContent.ContentType](/reference/tools/gradle-api/7.2/com/android/build/api/transform/QualifiedContent.ContentType)`?\u003e` | [getContentTypes](/reference/tools/gradle-api/7.2/com/android/build/api/transform/QualifiedContent#getContentTypes())`()` Returns the type of content that the stream represents. | | [File](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/File.html) | [getFile](/reference/tools/gradle-api/7.2/com/android/build/api/transform/QualifiedContent#getFile())`()` Returns he location of the content. | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [getName](/reference/tools/gradle-api/7.2/com/android/build/api/transform/QualifiedContent#getName())`()` Returns the name of the content. | | [Set](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`\u003c`[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`?\u003e` | [getScopes](/reference/tools/gradle-api/7.2/com/android/build/api/transform/QualifiedContent#getScopes())`()` Returns the scope of the content. | |\n\nPublic functions\n----------------\n\n### getChangedFiles\n\n```\nfun getChangedFiles(): Map\u003cFile?, Status?\u003e\n```\n\nReturns the changed files. This is only valid if the transform is in incremental mode."]]