deleteFileOrDirectory

fun deleteFileOrDirectory(fileOrDirectory: File)

Recursively deletes all the files under a directory. If the input file is not a directory, then this only deletes the file. This is recursive since directories must be empty before deletion.

Parameters

fileOrDirectory

a file or directory to be deleted.