Search code examples
osgiosgi-bundle

How to get localized values of OSGi bundle headers without a Bundle object


If I have an org.osgi.framework.Bundle object, I can ask for its localized headers (like Bundle-Name) using Bundle.getHeaders(<locale>).

But does there exist a similar facility that I can use to get the values oflocalized headers (taking the Bundle-Localization header into account, if present) when I just have a File, JarFile, or Manifest object? Or do I have to implement the whole lookup procedure myself (as outlined in the OSGi spec)?


Solution

  • That support is built into the OSGi framework. So if you are not asking the framework for the localized headers of a bundle, you will need to implement the specified rules yourself.