类 ServletContextResourcePatternLoader
java.lang.Object
cn.taketoday.core.io.PathMatchingPatternResourceLoader
cn.taketoday.web.servlet.support.ServletContextResourcePatternLoader
- 所有已实现的接口:
cn.taketoday.core.io.PatternResourceLoader,cn.taketoday.core.io.ResourceLoader
public class ServletContextResourcePatternLoader
extends cn.taketoday.core.io.PathMatchingPatternResourceLoader
ServletContext-aware subclass of
PathMatchingPatternResourceLoader,
able to find matching resources below the web application root directory
via ServletContext.getResourcePaths(java.lang.String). Falls back to the superclass'
file system checking for other resources.- 从以下版本开始:
- 4.0 2022/2/21 16:35
- 作者:
- Juergen Hoeller, Harry Yang
-
字段概要
字段从接口继承的字段 cn.taketoday.core.io.PatternResourceLoader
CLASSPATH_ALL_URL_PREFIX从接口继承的字段 cn.taketoday.core.io.ResourceLoader
CLASSPATH_URL_PREFIX -
构造器概要
构造器构造器说明ServletContextResourcePatternLoader(cn.taketoday.core.io.ResourceLoader resourceLoader) Create a new ServletContextResourcePatternResolver.ServletContextResourcePatternLoader(ServletContext servletContext) Create a new ServletContextResourcePatternResolver. -
方法概要
修饰符和类型方法说明protected voiddoFindPathMatchingFileResources(cn.taketoday.core.io.Resource rootDirResource, String subPattern, cn.taketoday.core.io.ResourceConsumer consumer) Overridden version which checks for ServletContextResource and usesServletContext.getResourcePathsto find matching resources below the web application root directory.private voiddoRetrieveMatchingJarEntries(String jarFilePath, String entryPattern, cn.taketoday.core.io.ResourceConsumer consumer) Extract entries from the given jar by pattern.protected voiddoRetrieveMatchingServletContextResources(ServletContext servletContext, String fullPattern, String dir, cn.taketoday.core.io.ResourceConsumer consumer) Recursively retrieve ServletContextResources that match the given pattern, adding them to the given result set.从类继承的方法 cn.taketoday.core.io.PathMatchingPatternResourceLoader
addAllClassLoaderJarRoots, addClassPathManifestEntries, convertClassLoaderURL, determineRootDir, doFindAllClassPathResources, doFindPathMatchingJarResources, findAllClassPathResources, findAllModulePathResources, findPathMatchingResources, getClassLoader, getJarFile, getPathMatcher, getResource, getResources, getRootLoader, isJarResource, rootDirResource, scan, setPathMatcher从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.core.io.PatternResourceLoader
getResourcesArray
-
字段详细资料
-
logger
private static final cn.taketoday.logging.Logger logger
-
-
构造器详细资料
-
ServletContextResourcePatternLoader
Create a new ServletContextResourcePatternResolver.- 参数:
servletContext- the ServletContext to load resources with- 另请参阅:
-
ServletContextResourcePatternLoader
public ServletContextResourcePatternLoader(cn.taketoday.core.io.ResourceLoader resourceLoader) Create a new ServletContextResourcePatternResolver.- 参数:
resourceLoader- the ResourceLoader to load root directories and actual resources with
-
-
方法详细资料
-
doFindPathMatchingFileResources
protected void doFindPathMatchingFileResources(cn.taketoday.core.io.Resource rootDirResource, String subPattern, cn.taketoday.core.io.ResourceConsumer consumer) throws IOException Overridden version which checks for ServletContextResource and usesServletContext.getResourcePathsto find matching resources below the web application root directory. In case of other resources, delegates to the superclass version.- 覆盖:
doFindPathMatchingFileResources在类中cn.taketoday.core.io.PathMatchingPatternResourceLoader- 抛出:
IOException- 另请参阅:
-
doRetrieveMatchingServletContextResources
protected void doRetrieveMatchingServletContextResources(ServletContext servletContext, String fullPattern, String dir, cn.taketoday.core.io.ResourceConsumer consumer) throws IOException Recursively retrieve ServletContextResources that match the given pattern, adding them to the given result set.- 参数:
servletContext- the ServletContext to work onfullPattern- the pattern to match against, with preprended root directory pathdir- the current directoryconsumer- Resource how to use- 抛出:
IOException- if directory contents could not be retrieved- 另请参阅:
-
doRetrieveMatchingJarEntries
private void doRetrieveMatchingJarEntries(String jarFilePath, String entryPattern, cn.taketoday.core.io.ResourceConsumer consumer) Extract entries from the given jar by pattern.- 参数:
jarFilePath- the path to the jar fileentryPattern- the pattern for jar entries to matchconsumer- Resource how to use
-