private RepositoryAdapter getOrCreateRepository() {
		String repositoryName = data.getRepositoryName();
		RepositoryServerAdapter server = data.getServer();

		if (!data.isNewRepository()) {
			RepositoryAdapter repository = server.getRepository(repositoryName);
			if (repository == null) {
				setStatusMessage("Can't open repository: " + repositoryName);
			}
			return repository;
		}

		try {
			RepositoryAdapter repository = server.createRepository(repositoryName);
			repository.setUserList(data.getProjectUsers(), data.allowAnonymousAccess());
			return repository;
		}
		catch (DuplicateNameException e) {
			setStatusMessage("Repository " + repositoryName + " exists");
		}
		catch (UserAccessException exc) {
			setStatusMessage("Could not update the user list: " + exc.getMessage());
		}
		catch (NotConnectedException e) {
			String statusMessage = e.getMessage();
			if (statusMessage == null) {
				String serverName = data.getServerInfo().getServerName();
				statusMessage = "Not connected to server " + serverName;
			}
			setStatusMessage(statusMessage);
		}
		catch (IOException e) {
			setStatusMessage("Error occurred while updating the user list: " + e.getMessage());
		}
		return null;
	}
Wizard model for creating new Ghidra projects.
Ghidra/Framework/Project/src/main/java/ghidra/framework/main/wizard/project/ProjectWizardModel.java