private Program openProgram(ProgramLocator locator, DomainFile domainFile,
			TaskMonitor monitor) {

		if (!Program.class.isAssignableFrom(domainFile.getDomainObjectClass())) {
			Msg.showError(this, null, "Error Opening Program",
				"File does not correspond to a Ghidra Program: " + locator);
			return null;
		}

		int version = locator.getVersion();
		if (version != DomainFile.DEFAULT_VERSION) {
			monitor.setMessage("Getting Version " + version + " for " + domainFile.getName());
			return openReadOnly(locator, domainFile, monitor);
		}
		monitor.setMessage("Opening " + locator);
		if (locator.isURL()) {
			return openReadOnly(locator, domainFile, monitor);
		}
		return openNormal(domainFile, monitor);

	}
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