api / org.gradle.api.file / FileVisitDetails

FileVisitDetails

interface FileVisitDetails : FileTreeElement

Provides access to details about a file or directory being visited by a FileVisitor.

See Also
FileTree#visit(groovy.lang.Closure)

Functions

stopVisiting

abstract fun stopVisiting(): Unit

Requests that file visiting terminate after the current file.

Inherited Functions

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()).

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.

getFile

abstract fun getFile(): File

Returns the file being visited.

getLastModified

abstract fun getLastModified(): Long

Returns the last modified time of this file at the time of file traversal.

getMode

abstract fun getMode(): Int

Returns the Unix permissions of this file, e.g. 0644.

getName

abstract fun getName(): String

Returns the base name of this file.

getPath

abstract fun getPath(): String

Returns the path of this file, relative to the root of the containing file tree. Always uses '/' as the hierarchy separator, regardless of platform file separator. Same as calling getRelativePath().getPathString().

getRelativePath

abstract fun getRelativePath(): RelativePath

Returns the path of this file, relative to the root of the containing file tree.

getSize

abstract fun getSize(): Long

Returns the size of this file at the time of file traversal.

isDirectory

abstract fun isDirectory(): Boolean

Returns true if this element is a directory, or false if this element is a regular file.

open

abstract fun open(): InputStream

Opens this file as an input stream. Generally, calling this method is more performant than calling new FileInputStream(getFile()).