Resource implementation for OSGi environments.
Lazy evaluation of the resource will be used. This implementation allows resource location inside:
- bundle space - if
osgibundle:
/ {@link #BUNDLE_URL_PREFIX}prefix is being used or none is specified. This space cotnains the bundle jar and its attached fragments. - bundle jar - if
osgibundlejar:
/ {@link #BUNDLE_JAR_URL_PREFIX}is specified. This space contains just the bundle jar. - class space - if {@link org.springframework.util.ResourceUtils#CLASSPATH_URL_PREFIX} isencountered. This space contains the bundle classpath, namely the bundle jar, its attached fragments and imported packages.
For more explanations on resource locations in OSGi, please see the
Access to Resources chapter from the OSGi spec.
OSGi framework specific prefixes (such as
bundleentry:
and
bundleresource:
under Equinox,
bundle:
under Knopflefish and Felix, etc..) are supported. Resources outside the OSGi space (
file:
,
http:
, etc..) are supported as well as the path is being resolved to an
URL
.
If no prefix is specified, the
bundle space will be used for locating a resource.
Note: When the
bundle space (bundle jar and its attached fragments) is being searched, multiple URLs can be found but this implementation will return only the first one. Consider using {@link OsgiBundleResourcePatternResolver} to retrieve all entries.
@author Costin Leau
@author Adrian Colyer
@author Sam Brannen