public static synchronized boolean prepareDirectory(File directory){
  if (directory.exists())   return true;
  directory.mkdirs();
  return directory.exists();
}

public static synchronized boolean prepareDirectory ( File directory ) { if ( directory . exists ( ) ) return true ; directory . mkdirs ( ) ; return directory . exists ( ) ; }
tries to create the directory incl . all super directories , returns true if at the end of the operation the directory exists .
