类 PortletContextResourcePatternResolver
- java.lang.Object
- org.springframework.core.io.support.PathMatchingResourcePatternResolver
- org.springframework.web.portlet.context.PortletContextResourcePatternResolver
- 所有已实现的接口:
ResourceLoader
,ResourcePatternResolver
public class PortletContextResourcePatternResolver extends PathMatchingResourcePatternResolver
PortletContext-aware subclass ofPathMatchingResourcePatternResolver
, able to find matching resources below the web application root directory via Portlet API'sPortletContext.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.- 从以下版本开始:
- 2.0
- 作者:
- Juergen Hoeller, John A. Lewis
字段概要
从接口继承的字段 org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
从接口继承的字段 org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
构造器概要
构造器 构造器 说明 PortletContextResourcePatternResolver(PortletContext portletContext)
Create a new PortletContextResourcePatternResolver.PortletContextResourcePatternResolver(ResourceLoader resourceLoader)
Create a new PortletContextResourcePatternResolver.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected Set<Resource>
doFindPathMatchingFileResources(Resource rootDirResource, String subPattern)
Overridden version which checks for PortletContextResource and usesPortletContext.getResourcePaths
to find matching resources below the web application root directory.protected void
doRetrieveMatchingPortletContextResources(PortletContext portletContext, String fullPattern, String dir, Set<Resource> result)
Recursively retrieve PortletContextResources that match the given pattern, adding them to the given result set.从类继承的方法 org.springframework.core.io.support.PathMatchingResourcePatternResolver
addAllClassLoaderJarRoots, addClassPathManifestEntries, convertClassLoaderURL, determineRootDir, doFindAllClassPathResources, doFindMatchingFileSystemResources, doFindPathMatchingJarResources, doFindPathMatchingJarResources, doRetrieveMatchingFiles, findAllClassPathResources, findPathMatchingResources, getClassLoader, getJarFile, getPathMatcher, getResource, getResourceLoader, getResources, isJarResource, resolveRootDirResource, retrieveMatchingFiles, setPathMatcher
构造器详细资料
PortletContextResourcePatternResolver
public PortletContextResourcePatternResolver(PortletContext portletContext)
Create a new PortletContextResourcePatternResolver.- 参数:
portletContext
- the PortletContext to load resources with- 另请参阅:
PortletContextResourceLoader(javax.portlet.PortletContext)
PortletContextResourcePatternResolver
public PortletContextResourcePatternResolver(ResourceLoader resourceLoader)
Create a new PortletContextResourcePatternResolver.- 参数:
resourceLoader
- the ResourceLoader to load root directories and actual resources with
方法详细资料
doFindPathMatchingFileResources
protected Set<Resource> doFindPathMatchingFileResources(Resource rootDirResource, String subPattern) throws IOException
Overridden version which checks for PortletContextResource and usesPortletContext.getResourcePaths
to find matching resources below the web application root directory. In case of other resources, delegates to the superclass version.- 覆盖:
doFindPathMatchingFileResources
在类中PathMatchingResourcePatternResolver
- 参数:
rootDirResource
- the root directory as ResourcesubPattern
- the sub pattern to match (below the root directory)- 返回:
- a mutable Set of matching Resource instances
- 抛出:
IOException
- in case of I/O errors- 另请参阅:
doRetrieveMatchingPortletContextResources(javax.portlet.PortletContext, java.lang.String, java.lang.String, java.util.Set<org.springframework.core.io.Resource>)
,PortletContextResource
,PortletContext.getResourcePaths(java.lang.String)
doRetrieveMatchingPortletContextResources
protected void doRetrieveMatchingPortletContextResources(PortletContext portletContext, String fullPattern, String dir, Set<Resource> result) throws IOException
Recursively retrieve PortletContextResources that match the given pattern, adding them to the given result set.- 参数:
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 to- 抛出:
IOException
- if directory contents could not be retrieved- 另请参阅:
PortletContextResource
,PortletContext.getResourcePaths(java.lang.String)