org.springframework.osgi.io
Class OsgiBundleResourceLoader
java.lang.Object
org.springframework.core.io.DefaultResourceLoader
org.springframework.osgi.io.OsgiBundleResourceLoader
- All Implemented Interfaces:
- ResourceLoader
public class OsgiBundleResourceLoader
- extends DefaultResourceLoader
OSGi specific ResourceLoader implementation.
The loader resolves paths inside an OSGi bundle using the bundle entries for
resource loading for any unqualified resource string.
Also understands the "bundle:" resource prefix for explicit loading of
resources from the bundle. When the bundle prefix is used the target resource
must be contained within the bundle (or attached fragments), the classpath is
not searched.
- Author:
- Adrian Colyer, Costin Leau
- See Also:
Bundle
,
OsgiBundleResource
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OsgiBundleResourceLoader
public OsgiBundleResourceLoader(Bundle bundle)
- Creates a OSGi aware ResourceLoader using the given bundle.
- Parameters:
bundle
-
getResourceByPath
protected Resource getResourceByPath(String path)
- Overrides:
getResourceByPath
in class DefaultResourceLoader
getResource
public Resource getResource(String location)
- Implementation of getResource that delegates to the bundle for any
unqualified resource reference or a reference starting with "bundle:"
- Specified by:
getResource
in interface ResourceLoader
- Overrides:
getResource
in class DefaultResourceLoader
getBundle
public final Bundle getBundle()
- Return the bundle for this resource.
Copyright © 2006-2007 Spring Framework. All Rights Reserved.