simulator/src/main/java/com/hazelcast/simulator/utils/FileUtils.java
public static void copyDirectory(File src, File target) {
        checkNotNull(src, "src can't be null");
        checkNotNull(target, "target can't be null");

        File[] files = src.listFiles();
        if (files == null) {
            return;
        }

        for (File srcFile : files) {
            if (srcFile.isDirectory()) {
                File targetChild = new File(target, srcFile.getName());
                ensureExistingDirectory(targetChild);
                copyDirectory(srcFile, targetChild);
            } else {
                copyFileToDirectory(srcFile, target);
            }
        }
    }
public static void copyDirectory(File src, File target) {
        checkNotNull(src, "src can't be null");
        checkNotNull(target, "target can't be null");

        File[] files = src.listFiles();
        if (files == null) {
            return;
        }

        for (File srcFile : files) {
            if (srcFile.isDirectory()) {
                File targetChild = new File(target, srcFile.getName());
                ensureExistingDirectory(targetChild);
                copyDirectory(srcFile, targetChild);
            } else {
                copyFileToDirectory(srcFile, target);
            }
        }
    }
Copies a directory recursively.

@param src    the src directory
@param target the target directory