static void collectPackagesFromDirectory(Path dirPath, Set<String> packages) {
		try (Stream<Path> walk = Files.walk(dirPath)) {
			walk.filter(p -> p.toString().endsWith(".class")).forEach(path -> {
				String relativePath = dirPath.relativize(path).toString();
				int lastSlash = relativePath.lastIndexOf(File.separatorChar);
				packages.add(lastSlash > 0
						? relativePath.substring(0, lastSlash).replace(File.separatorChar, '.')
						: "");
			});
		}
		catch (IOException e) {
			Msg.error(OSGiUtils.class, "Error while collecting packages from directory", e);
		}
	}
parse Export-Package string from a bundle manifest

@param exportPackageString Import-Package value
@return deduced capabilities or null if there was an error
@throws BundleException on parse failure
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/osgi/OSGiUtils.java