public static boolean copyFile(File from, File to) {
        if (!from.exists())
            return false;

        if (from.isDirectory()) {
            if (!to.exists()) {
                to.mkdirs();
            }
            File[] files = from.listFiles();
            List<Boolean> bools = new ArrayList<Boolean>();
            for (File f : files) {
                if (f.isDirectory()) {
                    bools.add(copyFile(f, new File(to + File.separator + f.getName())));
                } else {
                    bools.add(copySingleFile(f, new File(to + File.separator + f.getName())));
                }
            }
            for (Boolean b : bools) {
                if (!b) {
                    return false;
                }
            }
            return true;
        } else {
            return copySingleFile(from, to);
        }
    }