Here you can find the source of copyFiles(String srcPath, String destPath)
private static void copyFiles(String srcPath, String destPath) throws Throwable
//package com.java2s; //License from project: Open Source License import java.io.File; import java.nio.file.Files; import java.nio.file.StandardCopyOption; public class Main { private static void copyFiles(String srcPath, String destPath) throws Throwable { File srcDir = new File(srcPath); File destDir = new File(destPath); if (!destDir.exists()) new File(destPath).mkdirs(); destDir = new File(destPath); Files.copy(srcDir.toPath(), destDir.toPath(), StandardCopyOption.REPLACE_EXISTING); }//from w w w . ja v a2 s .co m }