@Override
    public void run(TaskMonitor monitor) {
		String contentType = domainFile.getContentType();
		try {
			monitor.setMessage("Getting Version " + versionNumber + " for " + domainFile.getName());
			if (immutable) {
				versionedObj =
					domainFile.getImmutableDomainObject(consumer, versionNumber, monitor);
			}
			else {
				// Upgrade will be performed if required
				versionedObj = domainFile.getReadOnlyDomainObject(consumer, versionNumber, monitor);
			}
		}
		catch (CancelledException e) {
			// ignore
		}
		catch (IOException e) {
			ClientUtil.handleException(AppInfo.getActiveProject().getRepository(), e,
				contentType + " Open", null);
		} catch (VersionException e) {
			if (immutable && e.isUpgradable()) {
				String detailMessage =
					e.getDetailMessage() == null ? "" : "\n" + e.getDetailMessage();
				String title = "Upgrade " + contentType + " Data? " + domainFile.getName();
				String message = "The " + contentType + " file you are attempting to open" +
					" is an older version." + detailMessage + "\n \n" +
					"Would you like to Upgrade it now?";
				int rc = OptionDialog.showOptionDialog(null, title, message, "Upgrade",
					OptionDialog.QUESTION_MESSAGE);
				if (rc == OptionDialog.OPTION_ONE) {
					// try again as read-only
					immutable = false;
					run(monitor);
				}
				return;
			}
			VersionExceptionHandler.showVersionError(null, domainFile.getName(),
				domainFile.getContentType(), contentType + " Open", e);
		}
	}
Construct task open specified domainFile read only or immutable.  Immutable mode should not
be used for content that will be modified.
If read-only an upgrade is performed if needed, if immutable the user will be prompted
if an upgrade should be performed if possible in which case it will open read-only.
@param consumer consumer of the domain object
@param domainFile domain file
@param versionNumber version
@param immutable true if the object should be open immutable, else read-only.
Ghidra/Framework/Project/src/main/java/ghidra/framework/main/GetDomainObjectTask.java