public void processURL(URL ghidraURL, List<File> filesToImport)
			throws IOException, MalformedURLException {

		if (options.readOnly && options.commit) {
			Msg.error(this,
				"Abort due to Headless analyzer error: The requested readOnly option is in conflict " +
					"with the commit option");
			return;
		}

		if (!"ghidra".equals(ghidraURL.getProtocol())) {
			throw new MalformedURLException("Unsupported repository URL: " + ghidraURL);
		}

		if (GhidraURL.isLocalProjectURL(ghidraURL)) {
			Msg.error(this,
				"Ghidra URL command form does not supported local project URLs (ghidra:/path...)");
			return;
		}

		String path = ghidraURL.getPath();
		if (path == null) {
			throw new MalformedURLException("Unsupported repository URL: " + ghidraURL);
		}

		path = path.trim();
		if (path.length() == 0) {
			throw new MalformedURLException("Unsupported repository URL: " + ghidraURL);
		}

		if (!options.runScriptsNoImport) { // Running in -import mode
			if ((filesToImport == null || filesToImport.size() == 0) &&
				options.preScripts.isEmpty() && options.postScripts.isEmpty()) {
				Msg.warn(this, "REPORT: Nothing to do ... must specify files for import.");
				return;
			}

			if (!path.endsWith("/")) {
				// force explicit folder path so that non-existent folders are created on import
				ghidraURL = new URL("ghidra", ghidraURL.getHost(), ghidraURL.getPort(), path + "/");
			}
		}
		else { // Running in -process mode
			if (path.endsWith("/") && path.length() > 1) {
				ghidraURL = new URL("ghidra", ghidraURL.getHost(), ghidraURL.getPort(),
					path.substring(0, path.length() - 1));
			}
		}

		List<String> parsedScriptPaths = parseScriptPaths(options.scriptPaths);
		GhidraScriptUtil.initialize(new BundleHost(), parsedScriptPaths);
		try {
			showConfiguredScriptPaths();
			compileScripts();

			Msg.info(HeadlessAnalyzer.class, "HEADLESS: execution starts");

			// force explicit folder access since file may have same name as folder
			ghidraURL = GhidraURL.getFolderURL(ghidraURL);

			Msg.info(this, "Opening ghidra repository folder: " + ghidraURL);

			GhidraURLQuery.queryRepositoryUrl(ghidraURL, options.readOnly,
				new GhidraURLResultHandlerAdapter() {

					@Override
					public void processResult(DomainFolder domainFolder, URL url,
							TaskMonitor monitor) throws IOException, CancelledException {
						try {
							project = new HeadlessProject(getProjectManager(),
								domainFolder.getProjectData());

							if (!checkUpdateOptions()) {
								return; // TODO: Should an exception be thrown?
							}

							if (options.runScriptsNoImport) {
								processNoImport(domainFolder.getPathname());
							}
							else {
								processWithImport(domainFolder.getPathname(), filesToImport);
							}
						}
						finally {
							if (project != null) {
								project.close();
							}
						}
					}

					@Override
					public void handleError(String title, String message, URL url,
							IOException cause) throws IOException {
						if (cause instanceof FileNotFoundException) {
							throw new IOException("Connect to repository folder failed");
						}
						if (cause != null) {
							throw cause;
						}
						throw new IOException(title + ": " + message);
					}
				}, TaskMonitor.DUMMY);

		}
		catch (CancelledException e) {
			throw new IOException(e); // unexpected
		}
		finally {
			GhidraScriptUtil.dispose();
		}
	}
Process the optional import file/directory list and process each imported file:
<ol>
<li>execute ordered list of pre-scripts</li>
<li>perform auto-analysis if not disabled</li>
<li>execute ordered list of post-scripts</li>
</ol>
If no import files or directories have been specified the ordered list
of pre/post scripts will be executed once.

@param ghidraURL ghidra URL for existing server repository and optional
                 folder path
@param filesToImport directories and files to be imported (null or empty
                     is acceptable if we are in -process mode)
@throws IOException if there was an IO-related problem
@throws MalformedURLException specified URL is invalid
Ghidra/Features/Base/src/main/java/ghidra/app/util/headless/HeadlessAnalyzer.java