{@link ContextPathStrategy} default implementation. This class takes intoaccount the OSGi bundle properties for determining the war context path. by iterating through the following properties, considering the first one that is available in the following order:
- Web-ContextPath manifest header (identical to the one in SpringSource Application Platform). If present, the value of this header will be used as the context path.
- bundle location - if present, the implementation will try to determine if the location points to a file or a folder. In both cases, the name will be returned without the extension (if it's present):
/root/bundle.jar -> /bundle /root/bundle/ -> /bundle /root/bundle.jar/ -> /bundle file:/path/bundle.jar -> /bundle jar:url:/root/bundle.jar -> /bundle
- bundle name - if present, it is used as a fall back to the bundle location (ex: /myBundle)
- bundle symbolic name - if present, it used as a fall back to the bundle name (ex: /org.comp.osgi.some.bundle)
- bundle identity - if neither of the properties above is present, the bundle object identity will be used as context path (ex: /BundleImpl-15a0305)
Additionally, the returned context path will be HTML encoded (using 'UTF-8') to avoid problems with unsafe characters (such as whitespace).
@see Bundle#getLocation()
@see Constants#BUNDLE_NAME
@see Bundle#getSymbolicName()
@see System#identityHashCode(Object)
@see URLEncoder#encode(String,String)
@author Costin Leau