code: public static synchronized void checkAndCreateUploadDir(File uploadDir) throws IOException {
  		if (uploadDir.exists() && uploadDir.canWrite()) {
  			LOG.info("Using directory {} for web frontend JAR file uploads.", uploadDir);
  		} else if (uploadDir.mkdirs() && uploadDir.canWrite()) {
  			LOG.info("Created directory {} for web frontend JAR file uploads.", uploadDir);
  		} else {
  			LOG.warn("Jar upload directory {} cannot be created or is not writable.", uploadDir.getAbsolutePath());
  			throw new IOException(
  				String.format("Jar upload directory %s cannot be created or is not writable.",
  					uploadDir.getAbsolutePath()));
  		}
  	}
docs: Checks whether the given directory exists and is writable. If it doesn't exist this method will attempt to create
  it.
  
  @param uploadDir directory to check
  @throws IOException if the directory does not exist and cannot be created, or if the directory isn't writable