Class ResourcePatternUtils
java.lang.Object
org.springframework.core.io.support.ResourcePatternUtils
Utility class for determining whether a given URL is a resource
location that can be loaded via a
ResourcePatternResolver.
Callers will usually assume that a location is a relative path
if the isUrl(String) method returns false.
- Since:
- 1.2.3
- Author:
- Juergen Hoeller
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourcePatternResolvergetResourcePatternResolver(ResourceLoader resourceLoader) Return a defaultResourcePatternResolverfor the givenResourceLoader.static booleanReturn whether the given resource location is a URL: either a special "classpath" or "classpath*" pseudo URL or a standard URL.
-
Constructor Details
-
ResourcePatternUtils
public ResourcePatternUtils()
-
-
Method Details
-
isUrl
Return whether the given resource location is a URL: either a special "classpath" or "classpath*" pseudo URL or a standard URL.- Parameters:
resourceLocation- the location String to check- Returns:
- whether the location qualifies as a URL
- See Also:
-
getResourcePatternResolver
public static ResourcePatternResolver getResourcePatternResolver(@Nullable ResourceLoader resourceLoader) Return a defaultResourcePatternResolverfor the givenResourceLoader.This might be the
ResourceLoaderitself, if it implements theResourcePatternResolverextension, or a defaultPathMatchingResourcePatternResolverbuilt on the givenResourceLoader.- Parameters:
resourceLoader- the ResourceLoader to build a pattern resolver for (may benullto indicate a default ResourceLoader)- Returns:
- the ResourcePatternResolver
- See Also:
-