code: 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;
  	}
docs: Creates a directory if it does not exist.
  
  <p>
  It will recursively create all the absolute path specified in the input
  parameter.
  
  @param directory
  the {@link File} containing the directory structure that is
  going to be created.
  @return a {@link File} pointing to the created directory
  @throws IOException if there was en error while creating the directory.