Class FileUtil


  • @Beta
    public class FileUtil
    extends Object
    File utilities.
    • Constructor Detail

      • FileUtil

        public FileUtil()
    • Method Detail

      • copyDirectory

        public static void copyDirectory​(Path source,
                                         Path destination)
                                  throws IOException
        Implementation of recursive directory copy, does NOT overwrite.
        Parameters:
        source - an existing source directory to copy from
        destination - an existing destination directory to copy to
        Throws:
        IllegalArgumentException - if source directory is same destination directory, either source or destination is not a directory, or destination is inside source
        IOException
      • copyDirectory

        public static void copyDirectory​(Path source,
                                         Path destination,
                                         List<Path> excludes)
                                  throws IOException
        Implementation of recursive directory copy, does NOT overwrite.
        Parameters:
        source - an existing source directory to copy from
        destination - an existing destination directory to copy to
        excludes - a list of paths in "source" to exclude
        Throws:
        IllegalArgumentException - if source directory is same destination directory, either source or destination is not a directory, or destination is inside source
        IOException