FileUtilities

expect class FileUtilities

Utility-class revolving around various file-interactions.

Author

Griefed

actual class FileUtilities

Utility-class revolving around various file-interactions.

Author

Griefed

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
expect fun checkFileType(file: File): FileType
expect fun checkFileType(file: String): FileType

Check the given file for its type, whether it is a regular file, a Windows link or a UNIX symlink.

actual fun checkFileType(file: String): FileType

Check the given file for its type, whether it is a regular file, a Windows link or a UNIX symlink.

Link copied to clipboard
fun deleteMultiple(vararg files: File)

Delete multiple files quietly.

Link copied to clipboard
expect fun isLink(file: File): Boolean

Check if the given file is a UNIX symlink or Windows lnk.

fun isLink(file: String): Boolean

Check if the given file is a UNIX symlink or Windows lnk.

Link copied to clipboard
expect fun isReadPermissionSet(fileOrDirectory: File): Boolean
expect fun isReadPermissionSet(fileOrDirectory: String): Boolean

Check the given file or directory for read-permission.

fun isReadPermissionSet(fileOrDirectory: Path): Boolean
actual fun isReadPermissionSet(fileOrDirectory: String): Boolean

Check the given file or directory for read-permission.

Link copied to clipboard
fun isReadWritePermissionSet(fileOrDirectory: Path): Boolean

Check the given file or directory for read- and write-permission.

Link copied to clipboard

Check the given file or directory for read- and write-permission.

Link copied to clipboard
expect fun isWritePermissionSet(fileOrDirectory: File): Boolean
expect fun isWritePermissionSet(fileOrDirectory: String): Boolean

Check the given file or directory for write-permission.

fun isWritePermissionSet(fileOrDirectory: Path): Boolean
actual fun isWritePermissionSet(fileOrDirectory: String): Boolean

Check the given file or directory for write-permission.

Link copied to clipboard
expect fun openFile(fileToOpen: File)
expect fun openFile(fileToOpen: String)

Open the specified file in an editor.

actual fun openFile(fileToOpen: String)

Open the specified file in an editor.

Link copied to clipboard
expect fun openFolder(folder: File)
expect fun openFolder(folder: String)

Open the specified folder in the file explorer.

actual fun openFolder(folder: String)

Open the specified folder in the file explorer.

Link copied to clipboard
expect fun replaceFile(sourceFile: File, destinationFile: File): Boolean

Move a file from source to destination, and replace the destination file if it exists.

Link copied to clipboard
expect fun resolveLink(link: File): String

Resolve a given link/symlink to its source.

Resolve a given link/symlink to its source.

Link copied to clipboard
expect fun unzipArchive(zipFile: String, destinationDirectory: String)

Unzips the downloaded modpack ZIP-archive to the specified directory.

actual fun unzipArchive(zipFile: String, destinationDirectory: String)

Unzips the downloaded modpack ZIP-archive to the specified directory.