common-plugin / com.cognifide.gradle.common.file.resolver / FileResolution

FileResolution

open class FileResolution

Constructors

<init>

FileResolution(group: FileGroup, id: String, resolver: (FileResolution) -> File)

Properties

dir

val dir: File

file

val file: File

group

val group: FileGroup

id

val id: String

Functions

archiveFile

Read single file from ZIP/TAR archive.

fun archiveFile(archive: File, entryPattern: String): File

archiveFiles

Read files from ZIP/TAR archive.

fun archiveFiles(archive: File, entriesPattern: String): Sequence<File>

archiveTree

Read files from ZIP/TAR archive.

fun archiveTree(archive: File): FileTree

copyArchiveFile

Extract & copy single archive file and copy it to target location only if it does not exist.

fun copyArchiveFile(archive: File, entryPattern: String, target: File): File

copyArchiveFiles

Extract & copy archive files and copy them to target directory only if it each file does not exist.

fun copyArchiveFiles(archive: File, entriesPattern: String, targetDir: File): Unit

copyFile

Copy source file to target only if it does not exist.

fun copyFile(source: File, target: File): Unit

copyToDirectory

Copy source file to target directory only if target file does not exist.

fun copyToDirectory(source: File, targetDir: File): Unit

resolve

Resolve file immediatelly.

fun resolve(): File

then

Perform operation on resolved file with ability to change it path.

fun then(operation: FileResolution.(File) -> File): Unit

use

Perform operation on resolved file, but do not change it path (work in-place).

fun use(operation: FileResolution.(File) -> Unit): Unit