private Program openFileMaybeUgrade(DomainFile domainFile, TaskMonitor monitor)
			throws IOException, CancelledException, VersionException {

		boolean recoverFile = false;
		if (!silent && domainFile.isInWritableProject() && domainFile.canRecover()) {
			recoverFile = askRecoverFile(domainFile.getName());
		}

		Program program = null;
		try {
			program = (Program) domainFile.getDomainObject(consumer, false, recoverFile, monitor);
		}
		catch (VersionException e) {
			if (VersionExceptionHandler.isUpgradeOK(null, domainFile, openPromptText, e)) {
				program =
					(Program) domainFile.getDomainObject(consumer, true, recoverFile, monitor);
			}
		}
		return program;
	}
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