# FileCopyDetails

@NonExtensible
interface FileCopyDetails : FileTreeElement, ContentFilterable, Describable(source)

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

copyTo
Link copied to clipboard
abstract fun copyTo(target: File): Boolean
abstract fun copyTo(output: OutputStream)
exclude
Link copied to clipboard
abstract fun exclude()
Excludes this file from the copy.
expand
Link copied to clipboard
abstract fun expand(properties: Map<String, out Any>): ContentFilterable
expand
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.

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

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