private void processWithImport(FSRL fsrl, String folderPath, Integer depth, boolean isFirstTime)
			throws IOException {
		try (RefdFile refdFile = fsService.getRefdFile(fsrl, TaskMonitor.DUMMY)) {
			GFile file = refdFile.file;
			if (depth == null && isFirstTime) {
				depth = file.isDirectory() ? 0 : 1; // set default depth
			}
			if ((options.recursive || isFirstTime) && file.isDirectory()) {
				processFS(file.getFilesystem(), file, folderPath, depth);
				return;
			}
			if (options.recursive && depth > 0 && processAsFS(fsrl, folderPath, depth)) {
				return;
			}
			if (!file.isDirectory() && processWithLoader(fsrl, folderPath)) {
				return;
			}
		}
		catch (CancelledException e) {
			Msg.info(this, "REPORT: Importing cancelled");
		}
	}
Process the specified filename within parentFolder.
@param parentFolder domain folder to be searched
@param filename name of file to be imported
@return true if one or more files processed
@throws IOException if an IO problem occurred.
Ghidra/Features/Base/src/main/java/ghidra/app/util/headless/HeadlessAnalyzer.java