public static boolean deleteRecursive(final File file){
  boolean result=true;
  if (file.isDirectory()) {
    for (    final File inner : file.listFiles()) {
      result&=deleteRecursive(inner);
    }
  }
  return result & file.delete();
}

public static boolean deleteRecursive ( final File file ) { boolean result = true ; if ( file . isDirectory ( ) ) { for ( final File inner : file . listFiles ( ) ) { result &= deleteRecursive ( inner ) ; } } return result & file . delete ( ) ; }
deletes a file or directory . if the file is a directory it recursively deletes it .
