Class FileUtils


  • public class FileUtils
    extends java.lang.Object
    File-utilities.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected FileUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean copyFolder​(java.io.File source, java.io.File target)
      Helper method to copy the world-folder.
      static boolean copyFolder​(java.io.File source, java.io.File target, java.util.List<java.lang.String> excludeFiles)
      Helper method to copy the world-folder.
      static boolean deleteFolder​(java.io.File file)
      Used to delete a folder.
      static boolean deleteFolderContents​(java.io.File file)
      Used to delete the contents of a folder, without deleting the folder itself.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileUtils

        protected FileUtils()
    • Method Detail

      • deleteFolder

        public static boolean deleteFolder​(java.io.File file)
        Used to delete a folder.
        Parameters:
        file - The folder to delete.
        Returns:
        true if the folder was successfully deleted.
      • deleteFolderContents

        public static boolean deleteFolderContents​(java.io.File file)
        Used to delete the contents of a folder, without deleting the folder itself.
        Parameters:
        file - The folder whose contents to delete.
        Returns:
        true if the contents were successfully deleted
      • copyFolder

        public static boolean copyFolder​(java.io.File source,
                                         java.io.File target)
        Helper method to copy the world-folder.
        Parameters:
        source - Source-File
        target - Target-File
        Returns:
        true if it had success
      • copyFolder

        public static boolean copyFolder​(java.io.File source,
                                         java.io.File target,
                                         java.util.List<java.lang.String> excludeFiles)
        Helper method to copy the world-folder.
        Parameters:
        source - Source-File
        target - Target-File
        excludeFiles - files to ignore and not copy over to Target-File
        Returns:
        true if it had success