private Program openReadOnly(ProgramLocator locator, DomainFile domainFile,
			TaskMonitor monitor) {
		String contentType = domainFile.getContentType();
		String path = locator.toString();
		try {
			return (Program) domainFile.getReadOnlyDomainObject(consumer, locator.getVersion(),
				monitor);
		}
		catch (CancelledException e) {
			// we don't care, the task has been cancelled
		}
		catch (IOException e) {
			if (locator.isDomainFile() && domainFile.isInWritableProject()) {
				ClientUtil.handleException(AppInfo.getActiveProject().getRepository(), e,
					"Get " + contentType, null);
			}
			else if (locator.getVersion() != DomainFile.DEFAULT_VERSION) {
				Msg.showError(this, null, "Error Getting Versioned Program",
					"Could not get version " + locator.getVersion() + " for " + path, e);
			}
			else {
				Msg.showError(this, null, "Error Getting Program",
					"Open program failed for " + path, e);
			}
		}
		catch (VersionException e) {
			VersionExceptionHandler.showVersionError(null, domainFile.getName(), contentType,
				"Open", e);
		}
		return null;
	}
Opens the program for the given location.
This method is intended to be invoked from within a {@link Task} or for headless operations. 
@param locator the program location to open
@param monitor the TaskMonitor used for status and cancelling
@return the opened program or null if the operation failed or was cancelled
Ghidra/Features/Base/src/main/java/ghidra/app/util/task/ProgramOpener.java