protected FileData<METADATATYPE> lookupFileInDir(
			Map<String, FileData<METADATATYPE>> dirContents, String filename,
			Comparator<String> nameComp) {
		if (dirContents == null) {
			return null;
		}
		if (nameComp == null) {
			// exact match
			return dirContents.get(filename);
		}
		List<FileData<METADATATYPE>> candidateFiles = new ArrayList<>();
		for (FileData<METADATATYPE> fd : dirContents.values()) {
			if (nameComp.compare(filename, fd.file.getName()) == 0) {
				if (fd.file.getName().equals(filename)) {
					return fd;
				}
				candidateFiles.add(fd);
			}
		}
		Collections.sort(candidateFiles,
			(f1, f2) -> f1.file.getName().compareTo(f2.file.getName()));
		return !candidateFiles.isEmpty() ? candidateFiles.get(0) : null;
	}
Walks a list of names of directories in nameparts (stopping prior to the last element)
starting at the root of the filesystem and returns the final directory.
<p>
Directories in a path that have not been encountered before (ie. a file's path references 
a directory that hasn't been mentioned yet as its own file entry) will have a stub entry 
GFile created for them if createIfMissing is true.
<p>
Superfluous slashes in the original filename (ie. name/sub//subafter_extra_slash) will
be represented as empty string elements in the nameparts array and will be skipped
as if they were not there.

@param nameparts String[] containing the elements of a path
for them
@param nameComp optional comparator that will compare names, usually case-sensitive vs case
insensitive
@return GFile that represents the parent directory
Ghidra/Features/Base/src/main/java/ghidra/formats/gfilesystem/FileSystemIndexHelper.java