file

abstract fun file(path: Any): File(source)

Resolves a file path relative to the project directory of this project. This method converts the supplied path based on its type:

Return

The resolved file. Never returns null.

Parameters

path

The object to resolve as a File.


abstract fun file(path: Any, validation: PathValidation): File(source)

Resolves a file path relative to the project directory of this project and validates it using the given scheme. See PathValidation for the list of possible validations.

Return

The resolved file. Never returns null.

Parameters

path

An object which toString method value is interpreted as a relative path to the project directory.

validation

The validation to perform on the file.

Throws

When the file does not meet the given validation constraint.