resolve

fun File.resolve(relative: File): File(source)

Adds relative file to this, considering this as a directory. If relative has a root, relative is returned back. For instance, File("/foo/bar").resolve(File("gav")) is File("/foo/bar/gav"). This function is complementary with relativeTo, so f.resolve(g.relativeTo(f)) == g should be always true except for different roots case.

Since Kotlin

1.0

Return

concatenated this and relative paths, or just relative if it's absolute.


fun File.resolve(relative: String): File(source)

Adds relative name to this, considering this as a directory. If relative has a root, relative is returned back. For instance, File("/foo/bar").resolve("gav") is File("/foo/bar/gav").

Since Kotlin

1.0

Return

concatenated this and relative paths, or just relative if it's absolute.