类 ResourcePatternUtils
- java.lang.Object
- org.springframework.core.io.support.ResourcePatternUtils
public abstract class ResourcePatternUtils extends Object
Utility class for determining whether a given URL is a resource location that can be loaded via aResourcePatternResolver
.Callers will usually assume that a location is a relative path if the
isUrl(String)
method returnsfalse
.- 从以下版本开始:
- 1.2.3
- 作者:
- Juergen Hoeller
构造器概要
构造器 构造器 说明 ResourcePatternUtils()
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static ResourcePatternResolver
getResourcePatternResolver(ResourceLoader resourceLoader)
Return a defaultResourcePatternResolver
for the givenResourceLoader
.static boolean
isUrl(String resourceLocation)
Return whether the given resource location is a URL: either a special "classpath" or "classpath*" pseudo URL or a standard URL.
构造器详细资料
ResourcePatternUtils
public ResourcePatternUtils()
方法详细资料
isUrl
public static boolean isUrl(String resourceLocation)
Return whether the given resource location is a URL: either a special "classpath" or "classpath*" pseudo URL or a standard URL.- 参数:
resourceLocation
- the location String to check- 返回:
- whether the location qualifies as a URL
- 另请参阅:
ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX
,ResourceUtils.CLASSPATH_URL_PREFIX
,ResourceUtils.isUrl(String)
,URL
getResourcePatternResolver
public static ResourcePatternResolver getResourcePatternResolver(ResourceLoader resourceLoader)
Return a defaultResourcePatternResolver
for the givenResourceLoader
.This might be the
ResourceLoader
itself, if it implements theResourcePatternResolver
extension, or a defaultPathMatchingResourcePatternResolver
built on the givenResourceLoader
.- 参数:
resourceLoader
- the ResourceLoader to build a pattern resolver for (may benull
to indicate a default ResourceLoader)- 返回:
- the ResourcePatternResolver
- 另请参阅:
PathMatchingResourcePatternResolver