Extensions for java.io.File
Copies this file with all its children to the specified destination target path. If some directories on the way to the destination are missing, then they will be created.
Delete this file with all its children. Note that if this operation fails then partial deletion may have taken place.
fun File.deleteRecursively(): Boolean
Determines whether this file path ends with the path of other file.
Returns the extension of this file (not including the dot), or an empty string if it doesn't have one.
val File.extension: String
Reads file by byte blocks and calls action for each block read. Block has default size which is implementation-dependent. This functions passes the byte array and amount of bytes in the array to the action function.
Determines whether this file has a root or it represents a relative path.
val File.isRooted: Boolean
Returns file's name without an extension.
val File.nameWithoutExtension: String
Adds relative file to this, considering this as a directory.
If relative has a root, relative is returned back.
This function is complementary with relativeTo,
f.resolve(g.relativeTo(f)) == g should be always
true except for different roots case.
Adds relative file to this parent directory.
If relative has a root or this has no parent directory, relative is returned back.