# 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
Copies this file to the given target file.
abstract fun copyTo(output: OutputStream)
Copies the content of this file to an output stream.
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
abstract fun expand(properties: Map<String, out Any>, action: Action<in ExpandDetails>): ContentFilterable
Expands property references in each file as it is copied.
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(closure: Closure): ContentFilterable
Adds a content filter based on the provided closure.
abstract fun filter(filterType: Class<out FilterReader>): ContentFilterable
abstract fun filter(properties: Map<String, out Any>, filterType: Class<out FilterReader>): ContentFilterable
Adds a content filter to be used during the copy.
abstract fun filter(transformer: Transformer<@Nullable String, String>): ContentFilterable
Adds a content filter based on the provided transformer.
filter
Link copied to clipboard
inline fun <T : FilterReader> ContentFilterable. filter(properties: Map<String, Any?>): ContentFilterable?
inline fun <T : FilterReader> ContentFilterable. filter(vararg properties: Pair<String, Any?>): ContentFilterable?
fun <T : FilterReader> ContentFilterable. filter(filterType: KClass<T>, properties: Map<String, Any?>): ContentFilterable?
fun <T : FilterReader> ContentFilterable. filter(filterType: KClass<T>, vararg properties: Pair<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
Returns the display name of this object.
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
Returns the file being visited.
getLastModified
Link copied to clipboard
abstract fun getLastModified(): Long
Returns the last modified time of this file at the time of file traversal.
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
Provides a read-only view of access permissions of this file.
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
Returns the size of this file at the time of file traversal.
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
Returns true if this element is a directory, or false if this element is a regular file.
open
Link copied to clipboard
abstract fun open(): InputStream
Opens this file as an input stream.
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.