DirectoryInput

interface DirectoryInput : QualifiedContent

A QualifiedContent of type directory.

This means the getFile() is the root directory containing the content.

This also contains incremental data if the transform is in incremental mode through getChangedFiles().

For a transform to run in incremental mode:

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 Status#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 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<File!, Status!>

Returns the changed files.

Inherited functions

MutableSet<QualifiedContent.ContentType!> getContentTypes()

Returns the type of content that the stream represents.

Even though this may return only DefaultContentType#RESOURCES or DefaultContentType#CLASSES, 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.

File getFile()

Returns he location of the content.

String getName()

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.

MutableSet<in QualifiedContent.Scope!> getScopes()

Returns the scope of the content.

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.