File file = new File("/download/");
setDirDelete(file); 

 

----------------------------------------------------------------------------------------

 

public static void setDirDelete(File file) throws SecurityException {
    File[] f = file.listFiles();
  
    for(int i=0; i<f.length; i++){
        if(f[i].isDirectory()){
            setDirDelete(f[i]);
        }else{
            f[i].delete();
        }
    }
}

 

 

+ Recent posts