common_helper/src/main/java/com/xiongyingqi/util/FileSystemUtils.java
private static void doCopyRecursively(File src, File dest) throws IOException {
        if (src.isDirectory()) {
            dest.mkdir();
            File[] entries = src.listFiles();
            if (entries == null) {
                throw new IOException("Could not list files in directory: " + src);
            }
            for (File entry : entries) {
                doCopyRecursively(entry, new File(dest, entry.getName()));
            }
        } else if (src.isFile()) {
            try {
                dest.createNewFile();
            } catch (IOException ex) {
                IOException ioex = new IOException("Failed to create file: " + dest);
                ioex.initCause(ex);
                throw ioex;
            }
            FileCopyUtils.copy(src, dest);
        } else {
            // Special File handle: neither a file not a directory.
            // Simply skip it when contained in nested directory...
        }
    }
private static void doCopyRecursively(File src, File dest) throws IOException {
        if (src.isDirectory()) {
            dest.mkdir();
            File[] entries = src.listFiles();
            if (entries == null) {
                throw new IOException("Could not list files in directory: " + src);
            }
            for (File entry : entries) {
                doCopyRecursively(entry, new File(dest, entry.getName()));
            }
        } else if (src.isFile()) {
            try {
                dest.createNewFile();
            } catch (IOException ex) {
                IOException ioex = new IOException("Failed to create file: " + dest);
                ioex.initCause(ex);
                throw ioex;
            }
            FileCopyUtils.copy(src, dest);
        } else {
            // Special File handle: neither a file not a directory.
            // Simply skip it when contained in nested directory...
        }
    }
private static void doCopyRecursively ( File src , File dest ) throws IOException { if ( src . isDirectory ( ) ) { dest . mkdir ( ) ; File [ ] entries = src . listFiles ( ) ; if ( entries == null ) { throw new IOException ( "Could not list files in directory: " + src ) ; } for ( File entry : entries ) { doCopyRecursively ( entry , new File ( dest , entry . getName ( ) ) ) ; } } else if ( src . isFile ( ) ) { try { dest . createNewFile ( ) ; } catch ( IOException ex ) { IOException ioex = new IOException ( "Failed to create file: " + dest ) ; ioex . initCause ( ex ) ; throw ioex ; } FileCopyUtils . copy ( src , dest ) ; } else { // Special File handle: neither a file not a directory. // Simply skip it when contained in nested directory... } }
Actually copy the contents of the {@code src} file/directory
to the {@code dest} file/directory.

@param src  the source directory
@param dest the destination directory
@throws java.io.IOException in the case of I/O errors
Actually copy the contents of the { @code src } file / directory to the { @code dest } file / directory .