private DomainFile findFileByID(GhidraFolderData folderData, String fileID, TaskMonitor monitor)
			throws IOException {
		if (!folderData.visited()) {
			// force files to be added to index and check index map
			folderData.refresh(false, true, monitor);
			String filePath = fileIdToPathIndex.get(fileID);
			if (filePath != null) {
				return projectData.getFile(filePath);
			}
		}
		for (String name : folderData.getFolderNames()) {
			if (monitor.isCancelled()) {
				return null;
			}
			GhidraFolderData subfolderData = folderData.getFolderData(name, true);
			if (subfolderData != null) {
				DomainFile df = findFileByID(subfolderData, fileID, monitor);
				if (df != null) {
					return df;
				}
			}
		}
		// perform extra check to handle potential race condition
		String filePath = fileIdToPathIndex.get(fileID);
		if (filePath != null) {
			return projectData.getFile(filePath);
		}
		return null;
	}
Helper class to maintain mapping of fileID's to DomainFile's.
Ghidra/Framework/Project/src/main/java/ghidra/framework/data/DomainFileIndex.java