private void copyDir(File src, File dest) throws IOException {
	if (src.isDirectory()) 	{
            if (!dest.exists()) {
                dest.mkdirs();
            }
            String list[] = src.list();
            for (int i = 0; i < list.length; i++) {
                File dest1 = new File(dest, list[i]);
                File src1 = new File(src, list[i]);
                copyDir(src1 , dest1);
            }
	} else {
            if(!dest.getParentFile().isDirectory()) {
                dest.getParentFile().mkdirs();
            }
            copyFile(src, dest);
	}
    }