code: public static void ensureDirectoryExists(final File directory, final String descriptionLabel)
      {
          if (!directory.exists())
          {
              if (!directory.mkdirs())
              {
                  throw new IllegalArgumentException("could not create " + descriptionLabel + " directory: " + directory);
              }
          }
      }
docs: Create a directory if it doesn't already exist.
  
  @param directory        the directory which definitely exists after this method call.
  @param descriptionLabel to associate with the directory for any exceptions.