public Program openProgram(String folderPath, String programName, boolean readOnly)
			throws IOException {
		String programPath = folderPath + FileSystem.SEPARATOR_CHAR + programName;
		DomainFile df = projectData.getFile(programPath);
		if (df == null) {
			throw new FileNotFoundException("File not found: " + programPath);
		}
		if (Program.class.isAssignableFrom(df.getDomainObjectClass())) {
			Program p;
			try {
				if (readOnly) {
					p = (Program) df.getReadOnlyDomainObject(this, FolderItem.LATEST_VERSION,
						MONITOR);
				}
				else {
					p = (Program) df.getDomainObject(this, true, false, MONITOR);
				}
			}
			catch (VersionException e) {
				throw new IOException(e.getMessage());
			}
			catch (CancelledException e) {
				throw new IOException("Cancelled");
			}
			initializeProgram(p, readOnly);
			return p;
		}
		throw new IOException("File is not a program: " + programPath);
	}
Opens a program.

@param folderPath
           the path of the program within the project. ("/" is root)
@param programName
           the name of the program to open.
@param readOnly
           flag if the program will only be read and not written.
@return an open program.
@throws IOException
            if there was a problem accessing the program
Ghidra/Features/Base/src/main/java/ghidra/base/project/GhidraProject.java