public Program importProgram(File file, Class<? extends Loader> loaderClass, Language language,
			CompilerSpec compilerSpec) throws CancelledException, DuplicateNameException,
			InvalidNameException, VersionException, IOException {
		MessageLog messageLog = new MessageLog();
		SingleLoaderFilter loaderFilter = new SingleLoaderFilter(loaderClass, null);
		LcsHintLoadSpecChooser opinionChoose = new LcsHintLoadSpecChooser(language, compilerSpec);
		LoadResults<Program> loadResults =
			AutoImporter.importFresh(file, project, null, this, messageLog, MONITOR, loaderFilter,
				opinionChoose, null, new LoaderArgsOptionChooser(loaderFilter));
		loadResults.releaseNonPrimary(this);
		return loadResults.getPrimaryDomainObject();
	}
Executes the give command on the program.

@param cmd
           the command to be applied to the program.
@param program
           the program on which the command is to be applied.
Ghidra/Features/Base/src/main/java/ghidra/base/project/GhidraProject.java