private static void searchJarFile(Set<String> set, File file, String resourceDirName,
			String extension) throws IOException {

		try (JarFile jarFile = new JarFile(file)) {
			Enumeration<JarEntry> entries = jarFile.entries();
			while (entries.hasMoreElements()) {
				JarEntry entry = entries.nextElement();
				if (entry.getSize() == 0) {
					continue;
				}

				String name = entry.getName();

				// the entry must match the pattern "resources/<resourceDirName>/xxx<extension> 
				// where extension may be null and 'xxx' is a filename and not another sub directory
				if (extension != null && !name.endsWith(extension)) {
					continue;
				}

				String startPath = resourceDirName;
				if (!name.startsWith(startPath)) {
					continue;
				}

				// is it a subdir?
				name = name.substring(startPath.length() + 1); // strip off valid path info
				File entryAsFile = new File(name);
				if (entryAsFile.getParent() != null) {
					continue; // the name was a subdir and not simply a file 
				}

				// add the entry; chop off "resources/"
				set.add(entry.getName());
			}
		}
	}
Search the given jar filename for files in 
resources with the given file extension.
@param set the set to which resource names will be added
@param file jar or zip filename
@param resourceDirName name of resource directory, e.g. "defaultTools"
@param extension file extension to look for
Ghidra/Framework/Gui/src/main/java/resources/ResourceManager.java