Details
-
Feature Request
-
Resolution: Done
-
Major
-
None
-
None
Description
Bundle Class Path Order
Once a bundle is resolved all its container namespaces are flattened to a single namespace that is then used by the class loader. Flattening has as a consequence that certain resources will disappear from the view, which resource remains and which disappear depends on the order of the flattening. The OSGi specification defines exactly what this order is. However, the rules for this ordering are many and non-trivial. For this reason, a Bundle Wiring allows the iteration over the resources of a bundle in the bundle class path order, reflecting the same flattening as that what the class loader will do. A bun- dle must be resolved to be able to iterate over its resources.
The method used to iterate over the resources in bundle class path order is listResources(String, String, int). This method takes a starting path in the namespace, a pattern to match (for example *.class for class resources) and a flag to indicate if the scan should recurs into directories or not.
This method has no counterpart in the standard class loader API.