public abstract class ResourcePatternUtils extends Object
Callers will usually assume that a location is a relative path
if the isUrl(String)
method returns false
.
Constructor and Description |
---|
ResourcePatternUtils() |
Modifier and Type | Method and Description |
---|---|
static ResourcePatternResolver |
getResourcePatternResolver(ResourceLoader resourceLoader)
Return a default ResourcePatternResolver for the given ResourceLoader.
|
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.
|
public static boolean isUrl(String resourceLocation)
resourceLocation
- the location String to checkResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX
,
ResourceUtils.CLASSPATH_URL_PREFIX
,
ResourceUtils.isUrl(String)
,
URL
public static ResourcePatternResolver getResourcePatternResolver(ResourceLoader resourceLoader)
This might be the ResourceLoader itself, if it implements the ResourcePatternResolver extension, or a PathMatchingResourcePatternResolver built on the given ResourceLoader.
resourceLoader
- the ResourceLoader to build a pattern resolver for
(may be null
to indicate a default ResourceLoader)PathMatchingResourcePatternResolver