Class FileUtils
java.lang.Object
org.mvplugins.multiverse.core.utils.FileUtils
File-utilities.
-
Method Summary
Modifier and TypeMethodDescriptionio.vavr.control.Try
<Void> copyFolder
(File sourceDir, File targetDir) Copies all the content of the given folder to the given target folder.io.vavr.control.Try
<Void> copyFolder
(File sourceDir, File targetDir, List<String> excludeFiles) Copies most of the content of the given folder to the given target folder, except the list of excluded files specified.io.vavr.control.Try
<Void> copyFolder
(Path sourceDir, Path targetDir) Copies all the content of the given folder to the given target folder.io.vavr.control.Try
<Void> copyFolder
(Path sourceDir, Path targetDir, List<String> excludeFiles) Copies most of the content of the given folder to the given target folder, except the list of excluded files specified.io.vavr.control.Try
<Void> deleteFolder
(File file) Deletes the given folder completely.io.vavr.control.Try
<Void> deleteFolder
(File file, Collection<String> keepFiles) io.vavr.control.Try
<Void> deleteFolder
(Path path, Collection<String> keepFiles) Deletes the given folder completely.@Nullable File
The bukkit.yml fileThe root server folder where Multiverse-Core is installed.@Nullable File
The server.properties file
-
Method Details
-
getServerFolder
The root server folder where Multiverse-Core is installed.- Returns:
- The root server folder
-
getBukkitConfig
The bukkit.yml file- Returns:
- The bukkit.yml file if exist, else null.
-
getServerProperties
The server.properties file- Returns:
- The server.properties file if exist, else null.
-
deleteFolder
Deletes the given folder completely.- Parameters:
file
- The folder to delete.- Returns:
- A
Try
that will containnull
if the folder was deleted successfully, or an exception if the folder could not be deleted.
-
deleteFolder
-
deleteFolder
Deletes the given folder completely.- Parameters:
path
- The folder to delete.- Returns:
- A
Try
that will containnull
if the folder was deleted successfully, or an exception if the folder could not be deleted.
-
copyFolder
Copies all the content of the given folder to the given target folder.- Parameters:
sourceDir
- The folder to copy.targetDir
- The target folder to copy to.- Returns:
- A
Try
that will containnull
if the folder was copied successfully, or an exception if the folder could not be copied.
-
copyFolder
public io.vavr.control.Try<Void> copyFolder(File sourceDir, File targetDir, List<String> excludeFiles) Copies most of the content of the given folder to the given target folder, except the list of excluded files specified.- Parameters:
sourceDir
- The folder to copy.targetDir
- The target folder to copy to.excludeFiles
- The list of files to exclude from copying.- Returns:
- A
Try
that will containnull
if the folder was copied successfully, or an exception if
-
copyFolder
Copies all the content of the given folder to the given target folder.- Parameters:
sourceDir
- The folder to copy.targetDir
- The target folder to copy to.- Returns:
- A
Try
that will containnull
if the folder was copied successfully, or an exception if the folder could not be copied.
-
copyFolder
public io.vavr.control.Try<Void> copyFolder(Path sourceDir, Path targetDir, List<String> excludeFiles) Copies most of the content of the given folder to the given target folder, except the list of excluded files specified.- Parameters:
sourceDir
- The folder to copy.targetDir
- The target folder to copy to.excludeFiles
- The list of files to exclude from copying.- Returns:
- A
Try
that will containnull
if the folder was copied successfully, or an exception if
-