public static void createDirIfNotExists(File dir) throws IOException {
  if (!dir.exists() && !dir.mkdirs()) {
    throw new IOException("Unable to create directory: " + dir.toString());
  }
}

public static void createDirIfNotExists ( File dir ) throws IOException { if ( ! dir . exists ( ) && ! dir . mkdirs ( ) ) { throw new IOException ( "Unable to create directory: " + dir . toString ( ) ) ; } }
creates a directory if it doesn ' t exist yet .
