FileUtils

object FileUtils

FileUtils is a utility class providing file-related operations for Java plugins.

Created: 21.07.2023 Author: Tobias Madlberger (Tobias)

Functions

Link copied to clipboard
fun copyAll(plugin: JavaPlugin, root: String): File

Copies all files and directories from the specified root folder within the plugin's JAR file to the plugin's data folder. If a folder is encountered during the copying process, it recursively copies its contents as well.

Link copied to clipboard
fun copyResource(plugin: JavaPlugin, res: String)

Copies a resource file from the plugin's JAR file to the plugin's data folder.

Link copied to clipboard
fun foreachIn(plugin: JavaPlugin, root: String, consumer: Consumer<Path>)

Lists all files and directories within the specified root folder within the plugin's JAR file.