private ProjectLock getProjectLock(ProjectLocator locator, boolean allowInteractiveForce)
			throws LockException {
		ProjectLock lock = new ProjectLock(locator);
		if (lock.lock()) {
			return lock;
		}

		String defaultMsg = "Unable to lock project! " + locator;
		
		// in headless mode, just spit out an error
		if (!allowInteractiveForce || SystemUtilities.isInHeadlessMode()) {
			throw new LockException(defaultMsg);
		}

		String projectStr = "Project: " + HTMLUtilities.escapeHTML(locator.getLocation()) +
			System.getProperty("file.separator") + HTMLUtilities.escapeHTML(locator.getName());
		String lockInformation = lock.getExistingLockFileInformation();
		if (!lock.canForceLock()) {
			String msg = "<html>Project is locked. You have another instance of Ghidra<br>" +
					"already running with this project open (locally or remotely).<br><br>" +
					projectStr + "<br><br>" + "Lock information: " + lockInformation;
			throw new LockException(msg);
		}

		int userChoice = OptionDialog.showOptionDialog(null, "Project Locked - Delete Lock?",
			"<html>Project is locked. You may have another instance of Ghidra<br>" +
				"already running with this project opened (locally or remotely).<br>" + projectStr +
				"<br><br>" + "If this is not the case, you can delete the lock file:  <br><b>" +
				locator.getProjectLockFile().getAbsolutePath() + "</b>.<br><br>" +
				"Lock information: " + lockInformation,
			"Delete Lock", OptionDialog.QUESTION_MESSAGE);
		if (userChoice == OptionDialog.OPTION_ONE) { // Delete Lock
			if (lock.forceLock()) {
				return lock;
			}

			Msg.showError(this, null, "Error", "Attempt to force lock failed! " + locator);
		}

		throw new LockException(defaultMsg);
	}
Creates a ProjectLock and attempts to lock it. This handles the case
where the project was previously locked.

@param locator the project locator
@param allowInteractiveForce if true, when a lock cannot be obtained, the
           user will be prompted
@return A locked ProjectLock
@throws LockException if the lock fails
Ghidra/Framework/Project/src/main/java/ghidra/framework/data/DefaultProjectData.java