org.springframework.osgi.io
Class OsgiBundleResourcePatternResolver

java.lang.Object
  extended by org.springframework.core.io.support.PathMatchingResourcePatternResolver
      extended by org.springframework.osgi.io.OsgiBundleResourcePatternResolver
All Implemented Interfaces:
ResourceLoader, ResourcePatternResolver

public class OsgiBundleResourcePatternResolver
extends PathMatchingResourcePatternResolver

OSGi-aware ResourcePatternResolver. Can find resources in the bundle jar and bundle space. See OsgiBundleResource for more information.

Note: classpath: and classpath*: prefixes are not (yet) supported as there are no methods for doing classpath discovery. A future version might add such functionality.

Author:
Costin Leau
See Also:
Bundle, OsgiBundleResource

Field Summary
 
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
 
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
 
Constructor Summary
OsgiBundleResourcePatternResolver(Bundle bundle)
           
OsgiBundleResourcePatternResolver(ResourceLoader resourceLoader)
           
 
Method Summary
 Resource[] getResources(String locationPattern)
           
protected  boolean isJarResource(Resource resource)
          

Overrides the default check up since computing the URL can be fairly expensive operation as there is no caching (due to the framework dynamic nature).

 
Methods inherited from class org.springframework.core.io.support.PathMatchingResourcePatternResolver
convertClassLoaderURL, determineRootDir, doFindMatchingFileSystemResources, doFindPathMatchingFileResources, doFindPathMatchingJarResources, doRetrieveMatchingFiles, findAllClassPathResources, findPathMatchingResources, getClassLoader, getPathMatcher, getResource, getResourceLoader, retrieveMatchingFiles, setPathMatcher
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OsgiBundleResourcePatternResolver

public OsgiBundleResourcePatternResolver(Bundle bundle)

OsgiBundleResourcePatternResolver

public OsgiBundleResourcePatternResolver(ResourceLoader resourceLoader)
Method Detail

getResources

public Resource[] getResources(String locationPattern)
                        throws IOException
Specified by:
getResources in interface ResourcePatternResolver
Overrides:
getResources in class PathMatchingResourcePatternResolver
Throws:
IOException

isJarResource

protected boolean isJarResource(Resource resource)
                         throws IOException

Overrides the default check up since computing the URL can be fairly expensive operation as there is no caching (due to the framework dynamic nature).

Overrides:
isJarResource in class PathMatchingResourcePatternResolver
Throws:
IOException


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