public class PortletContextResourcePatternResolver
extends org.springframework.core.io.support.PathMatchingResourcePatternResolver
PathMatchingResourcePatternResolver
,
able to find matching resources below the web application root directory
via Portlet API's PortletContext.getResourcePaths
.
Falls back to the superclass' file system checking for other resources.
The advantage of using PortletContext.getResourcePaths
to
find matching files is that it will work in a WAR file which has not been
expanded too.
Constructor and Description |
---|
PortletContextResourcePatternResolver(PortletContext portletContext)
Create a new PortletContextResourcePatternResolver.
|
PortletContextResourcePatternResolver(org.springframework.core.io.ResourceLoader resourceLoader)
Create a new PortletContextResourcePatternResolver.
|
Modifier and Type | Method and Description |
---|---|
protected Set<org.springframework.core.io.Resource> |
doFindPathMatchingFileResources(org.springframework.core.io.Resource rootDirResource,
String subPattern)
Overridden version which checks for PortletContextResource
and uses
PortletContext.getResourcePaths to find
matching resources below the web application root directory. |
protected void |
doRetrieveMatchingPortletContextResources(PortletContext portletContext,
String fullPattern,
String dir,
Set<org.springframework.core.io.Resource> result)
Recursively retrieve PortletContextResources that match the given pattern,
adding them to the given result set.
|
addAllClassLoaderJarRoots, addClassPathManifestEntries, convertClassLoaderURL, determineRootDir, doFindAllClassPathResources, doFindMatchingFileSystemResources, doFindPathMatchingJarResources, doFindPathMatchingJarResources, doRetrieveMatchingFiles, findAllClassPathResources, findPathMatchingResources, getClassLoader, getJarFile, getPathMatcher, getResource, getResourceLoader, getResources, isJarResource, resolveRootDirResource, retrieveMatchingFiles, setPathMatcher
public PortletContextResourcePatternResolver(PortletContext portletContext)
portletContext
- the PortletContext to load resources withPortletContextResourceLoader.PortletContextResourceLoader(javax.portlet.PortletContext)
public PortletContextResourcePatternResolver(org.springframework.core.io.ResourceLoader resourceLoader)
resourceLoader
- the ResourceLoader to load root directories and
actual resources withprotected Set<org.springframework.core.io.Resource> doFindPathMatchingFileResources(org.springframework.core.io.Resource rootDirResource, String subPattern) throws IOException
PortletContext.getResourcePaths
to find
matching resources below the web application root directory.
In case of other resources, delegates to the superclass version.doFindPathMatchingFileResources
in class org.springframework.core.io.support.PathMatchingResourcePatternResolver
IOException
doRetrieveMatchingPortletContextResources(javax.portlet.PortletContext, java.lang.String, java.lang.String, java.util.Set<org.springframework.core.io.Resource>)
,
PortletContextResource
,
PortletContext.getResourcePaths(java.lang.String)
protected void doRetrieveMatchingPortletContextResources(PortletContext portletContext, String fullPattern, String dir, Set<org.springframework.core.io.Resource> result) throws IOException
portletContext
- the PortletContext to work onfullPattern
- the pattern to match against,
with preprended root directory pathdir
- the current directoryresult
- the Set of matching Resources to add toIOException
- if directory contents could not be retrievedPortletContextResource
,
PortletContext.getResourcePaths(java.lang.String)