站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 2.1.0 API 文档英文版

ResourcePatternUtils (Spring Framework API 2.1) - Spring Framework 2.1.0 API 文档英文版


The Spring Framework

org.springframework.core.io.support
Class ResourcePatternUtils

java.lang.Object
  extended by 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 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
ResourcePatternUtils()
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourcePatternUtils

public ResourcePatternUtils()
Method Detail

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.

Parameters:
resourceLocation - the location String to check
Returns:
whether the location qualifies as a URL
See Also:
ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX, ResourceUtils.CLASSPATH_URL_PREFIX, ResourceUtils.isUrl(String), URL

getResourcePatternResolver

public static ResourcePatternResolver getResourcePatternResolver(ResourceLoader resourceLoader)
Return a default ResourcePatternResolver for the given ResourceLoader.

This might be the ResourceLoader itself, if it implements the ResourcePatternResolver extension, or a PathMatchingResourcePatternResolver built on the given ResourceLoader.

Parameters:
resourceLoader - the ResourceLoader to build a pattern resolver for (not null)
Returns:
the ResourcePatternResolver
See Also:
PathMatchingResourcePatternResolver

The Spring Framework

Copyright © 2002-2007 The Spring Framework.