isRooted
Determines whether this file has a root or it represents a relative path.
val File.isRooted: Boolean(source)
import java.io.File
fun main() {
val absolutePath = File("/usr/local/bin")
val relativePath = File("src/main/kotlin")
println("${absolutePath.path} is rooted? ${absolutePath.isRooted}") // true
println("${relativePath.path} is rooted? ${relativePath.isRooted}") // false
}