public static boolean delete(File path) {
        if (!path.exists())
            return false; 
        boolean ret = true;
        if (path.isDirectory()){
            for (File f : path.listFiles()){
                ret = ret && delete(f);
            }
        }
        return ret && path.delete();
    }