I am creating an IClasspathContainer that access an installed OSGi Bundle (Eclipse Plugin) withing eclipse. I get the IPath for the bundle by
Bundle bundle = Platform.getBundle(pluginId);
fullPath = FileLocator.getBundleFile(
return Path.fromOSString(fullPath);bundle).getAbsolutePath();
However I also want to offer the sources if the source bundle is installed. The source bundle is named by eclipse e.g. for a plugin org.example.myplugin the source bundle is named org.example.myplugin.source.
Does anybody know how to access the source bundle?
There is no direct way to find an OSGi bundle by it’s symbolic name, but one can easily do that oneself by looping through all bundles.
The location of the bundle can be accessed as: