api / org.gradle.api.file / FileTreeElement / copyTo

copyTo

abstract fun copyTo(output: OutputStream): Unit

Copies the content of this file to an output stream. Generally, calling this method is more performant than calling new FileInputStream(getFile()).

Parameters

output - The output stream to write to. The caller is responsible for closing this stream.

abstract fun copyTo(target: File): Boolean

Copies this file to the given target file. Does not copy the file if the target is already a copy of this file.

Parameters

target - the target file.

Return
true if this file was copied, false if it was up-to-date