public static File lookupFile(File baseDir, String path, Comparator<String> nameComp) {
		// TODO: if path is in unc format "//server/share/path", linux jvm's will normalize the
		// leading double slashes to a single "/".  Should the path be rejected immediately in a
		// non-windows jvm?
		path = Objects.requireNonNullElse(path, "/");
		File f = new File(baseDir, path); // null baseDir is okay
		if (!f.isAbsolute()) {
			Msg.debug(LocalFileSystem.class,
				"Non-absolute path encountered in LocalFileSystem lookup: " + path);
			// TODO: this would be better to throw an exception, but because some relative filenames
			// have leaked into some FSRLs, resolving those paths (even if it produces an incorrect
			// result) seems preferable.
			f = f.getAbsoluteFile();
		}
		try {
			if (nameComp == null || f.getParentFile() == null) {
				// If not using a comparator, or if the requested path is a 
				// root element (eg "/", or "c:\\"), don't do per-directory-path lookups.

				f = updateCaseInsensitiveFilePath(f);
				return (FSUtilities.isSymlink(f) || f.exists()) ? f : null;
			}

			// For path "/subdir/file", pathParts will contain, in reverse order:
			// [/subdir/file, /subdir, /]
			// The root element ("/", or "c:/") will never be subjected to the name comparator
			// The case of each element will be what was specified in the path parameter.
			// Lookup each element in its parent directory, using the comparator to find the file
			// in the full listing of each directory.
			// If requested path has "." and ".." elements, findInDir() will not find them, 
			// avoiding path traversal issues.
			// TODO: shouldn't use findInDir on the server and share parts of a UNC path "//server/share"
			List<File> pathParts = getFilePathParts(f);

			for (int i = pathParts.size() - 2 /*skip root ele*/; i >= 0; i--) {
				File parentDir = pathParts.get(i + 1);
				File part = pathParts.get(i);
				File foundFile = findInDir(parentDir, part.getName(), nameComp);
				if (foundFile == null) {
					return null;
				}
				pathParts.set(i, foundFile);
			}
			return pathParts.get(0);
		}
		catch (IOException e) {
			Msg.warn(LocalFileSystem.class, "Error resolving path: " + path, e);
			return null;
		}
	}
Looks up a file, by its string path, using a custom comparator.
<p>
If any element of the path, or the filename are not found, returns a null.
<p>
A null custom comparator avoids testing each element of the directory path and instead
relies on the native local file system's name matching.

@param baseDir optional directory to start lookup at 
@param path String path
@param nameComp optional {@link Comparator} that will compare filenames, or {@code null} 
to use native local file system lookup (eg. case-insensitive on windows)
@return File that points to the requested path, or null if file was not present on the
local filesystem (because it doesn't exist, or the name comparison function rejected it)
Ghidra/Features/Base/src/main/java/ghidra/formats/gfilesystem/LocalFileSystem.java