FileCopyDetails

Provides details about a file or directory about to be copied, and allows some aspects of the destination file to be modified.

Using this interface, you can change the destination path of the file, filter the content of the file, or exclude the file from the result entirely.

Access to the source file itself after any filters have been added is not a supported operation.

Functions

Link copied to clipboard
abstract fun copyTo(target: File): Boolean
abstract fun copyTo(output: OutputStream)
Link copied to clipboard
abstract fun exclude()
Excludes this file from the copy.
Link copied to clipboard
abstract fun expand(properties: Map<String, out Any>): ContentFilterable
Link copied to clipboard
inline fun ContentFilterable.expand(vararg properties: Pair<String, Any?>): ContentFilterable
inline fun ContentFilterable.expand(vararg properties: Pair<String, Any?>, action: Action<in ExpandDetails>): ContentFilterable

Kotlin extension function for org.gradle.api.file.ContentFilterable.expand.

Link copied to clipboard
abstract fun filter(properties: Map<String, out Any>, filterType: Class<out FilterReader>): ContentFilterable
Link copied to clipboard
inline fun <T : FilterReader> ContentFilterable.filter(vararg properties: Pair<String, Any?>): ContentFilterable
fun <T : FilterReader> ContentFilterable.filter(filterType: KClass<T>, vararg properties: Pair<String, Any?>): ContentFilterable
fun <T : FilterReader> ContentFilterable.filter(filterType: KClass<T>, properties: Map<String, Any?>): ContentFilterable

Adds a content filter to be used during the copy. Multiple calls add additional filters to the filter chain. Each filter should implement FilterReader. Import org.apache.tools.ant.filters.* for access to all the standard Ant filters.

inline fun ContentFilterable.filter(filterType: KClass<out FilterReader>, vararg properties: Pair<String, Any?>): ContentFilterable

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.file.ContentFilterable.filter.

Link copied to clipboard
abstract fun getDisplayName(): String
Link copied to clipboard
The strategy to use if there is already a file at this file's destination.
Link copied to clipboard
abstract fun getFile(): File
Link copied to clipboard
abstract fun getLastModified(): Long
Link copied to clipboard
abstract fun getMode(): Int
Link copied to clipboard
abstract fun getName(): String
Returns the base name of this file at the copy destination.
Link copied to clipboard
abstract fun getPath(): String
Returns the path of this file, relative to the root of the copy destination.
Link copied to clipboard
Link copied to clipboard
Returns the path of this file, relative to the root of the copy destination.
Link copied to clipboard
Returns the path of this file, relative to the root of the containing file tree.
Link copied to clipboard
abstract fun getSize(): Long
Link copied to clipboard
abstract fun getSourceName(): String
Returns the base name of this file at the copy source.
Link copied to clipboard
abstract fun getSourcePath(): String
Returns the path of this file, relative to the root of the containing file tree.
Link copied to clipboard
abstract fun isDirectory(): Boolean
Link copied to clipboard
abstract fun open(): InputStream
Link copied to clipboard
abstract fun permissions(configureAction: Action<in ConfigurableFilePermissions>)
Configuration action for specifying file and directory access permissions.
Link copied to clipboard
The strategy to use if there is already a file at this file's destination.
Link copied to clipboard
abstract fun setMode(mode: Int)
Sets the Unix permissions of this file.
Link copied to clipboard
abstract fun setName(name: String)
Sets the destination name of this file.
Link copied to clipboard
abstract fun setPath(path: String)
Sets the destination path of this file.
Link copied to clipboard
abstract fun setPermissions(permissions: FilePermissions)
Set file and directory access permissions based on an externally provided permission instance.
Link copied to clipboard
abstract fun setRelativePath(path: RelativePath)
Sets the destination path of this file.