public static boolean delete(File f){
  if (f.isFile())   return f.delete();
 else   if (f.isDirectory()) {
    boolean b=clearDir(f);
    b&=f.delete();
    return b;
  }
 else   return false;
}

public static boolean delete ( File f ) { if ( f . isFile ( ) ) return f . delete ( ) ; else if ( f . isDirectory ( ) ) { boolean b = clearDir ( f ) ; b &= f . delete ( ) ; return b ; } else return false ; }
deletes the given file and , if it is a directory , delete all its sub - directories and sub - files .
