private static void delete(File f){
  if (f.isDirectory()) {
    for (    File c : f.listFiles()) {
      delete(c);
    }
  }
  if (!f.delete()) {
    PrintStream err=System.err;
    err.println("Failed to delete file: " + f);
  }
}

private static void delete ( File f ) { if ( f . isDirectory ( ) ) { for ( File c : f . listFiles ( ) ) { delete ( c ) ; } } if ( ! f . delete ( ) ) { PrintStream err = System . err ; err . println ( "Failed to delete file: " + f ) ; } }
recursively deletes a file that may represent a directory .
