@Override
	public StatusCode connect(boolean readOnlyAccess) throws IOException {

		if (statusCode != null) {
			throw new IllegalStateException("already connected");
		}

		this.readOnly = readOnlyAccess;

		statusCode = StatusCode.UNAVAILABLE; // if uncaught exception occurs

		repositoryServerAdapter =
			ClientUtil.getRepositoryServer(url.getHost(), url.getPort(), true);
		if (!repositoryServerAdapter.isConnected()) {
			if (repositoryServerAdapter.isCancelled()) {
				return statusCode;
			}
			Throwable t = repositoryServerAdapter.getLastConnectError();
			if (t instanceof LoginException) {
				statusCode = StatusCode.UNAUTHORIZED;
			}
			return statusCode;
		}

		if (repositoryName == null) {
			if (repositoryServerAdapter.isReadOnly()) {
				this.readOnly = true; // write access not permitted
				Msg.warn(this, "User does not have write permission for server");
			}
			statusCode = StatusCode.OK;
			return statusCode;
		}

		repositoryAdapter = repositoryServerAdapter.getRepository(repositoryName);
		try {
			repositoryAdapter.connect();
		}
		catch (RepositoryNotFoundException e) {
			statusCode = StatusCode.NOT_FOUND;
			return statusCode;
		}

		if (repositoryAdapter.isConnected()) {
			statusCode = StatusCode.OK;
			if (!repositoryAdapter.getUser().hasWritePermission()) {
				if (!readOnly) {
					this.readOnly = true; // write access not permitted
					Msg.warn(this,
						"User does not have write permission for repository: " + repositoryName);
				}
			}
			resolveItemPath();
		}
		else {
			statusCode = StatusCode.UNAUTHORIZED;
		}

		return statusCode;
	}
Construct a protocol connector for use with a legacy Ghidra Server 
repository (RMI-based server)
@param ghidraURL Ghidra Server repository URL (ghidra://server/repo/...)
@throws MalformedURLException if URL is invalid
Ghidra/Framework/Project/src/main/java/ghidra/framework/protocol/ghidra/DefaultGhidraProtocolConnector.java