Class FileUtil


  • public final class FileUtil
    extends java.lang.Object
    Static utility methods for recursively copying and deleting files and directories.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void copy​(java.io.File src, java.io.File dest)
      Recursively copies the given file or directory to the given destination.
      static void delete​(java.io.File f)
      Recursively deletes the given file or directory.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • copy

        public static void copy​(java.io.File src,
                                java.io.File dest)
                         throws java.io.IOException
        Recursively copies the given file or directory to the given destination.
        Parameters:
        src - source file or directory
        dest - destination file or directory
        Throws:
        java.io.IOException - if the file or directory cannot be copied
      • delete

        public static void delete​(java.io.File f)
                           throws java.io.IOException
        Recursively deletes the given file or directory.
        Parameters:
        f - file or directory
        Throws:
        java.io.IOException - if the file or directory cannot be deleted