public static void buildDirectoryStructure(SquashFragmentTable fragTable,
			SquashDirectoryTable dirTable, SquashInodeTable inodes,
			FileSystemIndexHelper<SquashedFile> fsih, TaskMonitor monitor)
			throws CancelledException, IOException {

		SquashInode[] inodeArray = inodes.getInodes();

		SquashInode rootInode = inodes.getRootInode();

		// Make sure the root inode is a directory
		if (rootInode != null && rootInode.isDir()) {

			// Treat root inode as a directory inode
			SquashBasicDirectoryInode dirInode = (SquashBasicDirectoryInode) rootInode;

			// For each header associated with the root inode, process all entries
			List<SquashDirectoryTableHeader> headers = dirTable.getHeaders(dirInode);

			if (headers.size() == 0) {
				throw new IOException("Unable to find headers for the root directory");
			}

			for (SquashDirectoryTableHeader header : headers) {

				// For all files/directories immediately under the root
				List<SquashDirectoryTableEntry> entries = header.getEntries();
				for (SquashDirectoryTableEntry entry : entries) {

					// Recurse down the directory tree, storing directories and files
					assignPathsRecursively(fragTable, dirTable, entry, inodeArray,
						fsih.getRootDir(), fsih, monitor);
				}
			}
		}
		else {
			// If root is NOT a directory, stop processing
			throw new IOException("Root inode was not a directory!");
		}
	}
Assemble the directory structure of the archive
@param fragTable The processed fragment table of the archive
@param dirTable The processed directory table of the archive
@param inodes The processed inode table of the archive
@param fsih An index helper
@param monitor Monitor to allow the user to cancel the load
@throws CancelledException Archive load was cancelled
@throws IOException Root inode was not a directory
Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/squashfs/SquashUtils.java