org.springframework.osgi.io
Class OsgiBundleResourceLoader

java.lang.Object
  extended by org.springframework.core.io.DefaultResourceLoader
      extended by org.springframework.osgi.io.OsgiBundleResourceLoader
All Implemented Interfaces:
ResourceLoader

public class OsgiBundleResourceLoader
extends DefaultResourceLoader

OSGi specific ResourceLoader implementation. This loader resolves paths inside an OSGi bundle using the bundle native methods. Please see OsgiBundleResource javadoc for information on what prefixes are supported.

Author:
Adrian Colyer, Costin Leau
See Also:
Bundle, OsgiBundleResource

Field Summary
 
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
 
Constructor Summary
OsgiBundleResourceLoader(Bundle bundle)
          Creates a OSGi aware ResourceLoader using the given bundle.
 
Method Summary
 Bundle getBundle()
          Returns the bundle used by this loader.
 Resource getResource(String location)
           
protected  Resource getResourceByPath(String path)
           
 
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, setClassLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OsgiBundleResourceLoader

public OsgiBundleResourceLoader(Bundle bundle)
Creates a OSGi aware ResourceLoader using the given bundle.

Parameters:
bundle - OSGi Bundle to be used by this loader loader.
Method Detail

getResourceByPath

protected Resource getResourceByPath(String path)
Overrides:
getResourceByPath in class DefaultResourceLoader

getResource

public Resource getResource(String location)
Specified by:
getResource in interface ResourceLoader
Overrides:
getResource in class DefaultResourceLoader

getBundle

public final Bundle getBundle()
Returns the bundle used by this loader.

Returns:
OSGi Bundle used by this resource


Copyright © 2006-2011 Spring Framework. All Rights Reserved.