Is it possible to find all classes or interfaces in a given package? There is no simple way to do it in "plain Java", but OSGi probably does a better job, doesn't it?
The answer is yes starting in 4.3. A new API has been added:
BundleWiring.listResources(String path, String filePattern, int options)
which can be used to scan the class path of a bundle. With the appropriate parameters, you can get the names of all the classes in a package.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With