public boolean outputRecursively(File baseFile, String jarPath, TaskMonitor monitor) {

		boolean succeeded = true;
		File[] subFiles = new File[0];

		if (baseFile.isDirectory()) {
			subFiles = baseFile.listFiles();
			for (int i = 0; i < subFiles.length; i++) {
				if (monitor.isCancelled()) {
					break;
				}
				String newPath = jarPath + baseFile.getName() + File.separator;
				succeeded = outputRecursively(subFiles[i], newPath, monitor) && succeeded;
			}
		}
		else {
			String name = baseFile.getName();
			for (int i = 0; i < excludedExtensions.length; i++) {
				if (name.endsWith(excludedExtensions[i])) {
					return true;
				}
			}
			succeeded = outputFile(baseFile, jarPath, monitor);
		}
		return succeeded;
	}
Recursively outputs a directory to the jar output stream
If baseFile is a file then it is simply output to the jar.

@param baseFile the file or directory to be output
@param jarPath the base path to prepend to the files as they are written
to the jar output stream.

@return true if all files are recursively output to the jar file.
Ghidra/Framework/Generic/src/main/java/generic/io/JarWriter.java