public static File createDirIfNotExists(File directory) throws IOException {
  if (!directory.isDirectory()) {
    if (!directory.mkdirs()) {
      throw new IOException("Failed to create directory: " + directory.getAbsolutePath());
    }
  }
  return directory;
}

public static File createDirIfNotExists ( File directory ) throws IOException { if ( ! directory . isDirectory ( ) ) { if ( ! directory . mkdirs ( ) ) { throw new IOException ( "Failed to create directory: " + directory . getAbsolutePath ( ) ) ; } } return directory ; }
creates a directory if it does not exist . < p > it will recursively create all the absolute path specified in the input parameter .
