public abstract class ResourcePatternUtils extends Object
ResourcePatternResolver.
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(@Nullable String resourceLocation)
resourceLocation - the location String to checkResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX,
ResourceUtils.CLASSPATH_URL_PREFIX,
ResourceUtils.isUrl(String),
URLpublic static ResourcePatternResolver getResourcePatternResolver(@Nullable ResourceLoader resourceLoader)
ResourcePatternResolver for the given ResourceLoader.
This might be the ResourceLoader itself, if it implements the
ResourcePatternResolver extension, or a default
PathMatchingResourcePatternResolver built on the given ResourceLoader.
resourceLoader - the ResourceLoader to build a pattern resolver for
(may be null to indicate a default ResourceLoader)PathMatchingResourcePatternResolver