protected void processDirectory(GFile srcGFileDirectory, File destDirectory,
			TaskMonitor monitor) throws IOException, CancelledException {

		if (isSpecialDirectory(srcGFileDirectory)) {
			return;
		}

		if (!FileUtilities.isPathContainedWithin(rootOutputDirectory, destDirectory)) {
			// This can happen with hostile relative paths supplied by the data in the src filesystem.
			String srcPath = (srcGFileDirectory != null) ? srcGFileDirectory.getPath() : "/";
			throw new IOException("Extracted directory " + srcPath + " [" + destDirectory +
				"] would be outside of root destination directory: " + rootOutputDirectory);
		}

		if (!destDirectory.isDirectory() && !destDirectory.mkdirs()) {
			throw new IOException("Failed to create destination directory " + destDirectory);
		}
		totalDirsExportedCount++;

		for (GFile srcFile : fs.getListing(srcGFileDirectory)) {
			monitor.checkCancelled();

			String destFname = mapSourceFilenameToDest(srcFile);

			File destFSFile = new File(destDirectory, destFname);
			if (srcFile.isDirectory()) {
				processDirectory(srcFile, destFSFile, monitor);
			}
			else {
				processFile(srcFile, destFSFile, monitor);
			}
		}
	}
Extract the contents of a directory in a {@link GFileSystem} into a local file system
directory.
<p>
The destination directory is created if not present.

@param srcGFileDirectory if null, directory is filesystem root
@param destDirectory destination / output directory
@param monitor {@link TaskMonitor} to watch and update with progress
@throws IOException if IO problem.
@throws CancelledException
Ghidra/Features/Base/src/main/java/ghidra/formats/gfilesystem/AbstractFileExtractorTask.java