private FileData<METADATATYPE> doStoreFile(String filename, GFile parent, long fileIndex,
			boolean isDirectory, long length, String symlinkPath, METADATATYPE metadata) {
		parent = (parent == null) ? rootDir.file : parent;
		long fileNum = (fileIndex != -1) ? fileIndex : fileToEntryMap.size();
		if (fileIndexToEntryMap.containsKey(fileNum)) {
			Msg.warn(this, "Duplicate fileNum %d for file %s/%s".formatted(fileNum,
				parent.getPath(), filename));
		}

		Map<String, FileData<METADATATYPE>> dirContents = getDirectoryContents(parent, true);
		String uniqueName = makeUniqueFilename(dirContents.containsKey(filename) && !isDirectory,
			filename, fileNum);

		GFile file = createNewFile(parent, uniqueName, isDirectory, length, metadata);

		FileData<METADATATYPE> fileData = new FileData<>(file, metadata, fileNum, symlinkPath);
		fileToEntryMap.put(file, fileData);
		fileIndexToEntryMap.put(fileNum, fileData);

		dirContents.put(uniqueName, fileData);
		if (isDirectory) {
			// side-effect of get will eagerly create the directorylisting entry 
			getDirectoryContents(file, true);
		}

		return fileData;
	}
Creates and stores a file entry that is a symlink into in-memory indexes.
<p>
Use this when you already know the parent directory GFile object.
<p>
Filenames that are not unique in their directory will have a "[nnn]"
suffix added to the resultant GFile name, where nnn is the file's
order of occurrence in the container file.

@param filename the new file's name
@param parent the new file's parent directory
@param fileIndex the filesystem specific unique index for this file, or -1
if not available
@param symlinkPath destination of the symlink
@param length number of bytes in the file or -1 if not known or directory
@param metadata opaque blob that will be stored and associated with the new
GFile instance
@return new GFile instance
Ghidra/Features/Base/src/main/java/ghidra/formats/gfilesystem/FileSystemIndexHelper.java