Save This Page
Home » spring-framework-2.5.5-with-dependencies » org.springframework » core » io » support » [javadoc | source]
org.springframework.core.io.support
public interface: ResourcePatternResolver [javadoc | source]

All Implemented Interfaces:
    ResourceLoader

All Known Implementing Classes:
    XmlWebApplicationContext, StaticApplicationContext, ClassPathXmlApplicationContext, GenericApplicationContext, AbstractXmlApplicationContext, GenericWebApplicationContext, ResourceAdapterApplicationContext, AbstractRefreshableWebApplicationContext, ConfigurableApplicationContext, FileSystemXmlApplicationContext, AbstractRefreshableConfigApplicationContext, WebApplicationContext, ConfigurableWebApplicationContext, StaticPortletApplicationContext, StaticWebApplicationContext, AbstractApplicationContext, PortletContextResourcePatternResolver, AbstractRefreshableApplicationContext, AbstractRefreshablePortletApplicationContext, PathMatchingResourcePatternResolver, ServletContextResourcePatternResolver, XmlPortletApplicationContext, ConfigurablePortletApplicationContext, ApplicationContext

Strategy interface for resolving a location pattern (for example, an Ant-style path pattern) into Resource objects.

This is an extension to the org.springframework.core.io.ResourceLoader interface. A passed-in ResourceLoader (for example, an org.springframework.context.ApplicationContext passed in via org.springframework.context.ResourceLoaderAware when running in a context) can be checked whether it implements this extended interface too.

PathMatchingResourcePatternResolver is a standalone implementation that is usable outside an ApplicationContext, also used by ResourceArrayPropertyEditor for populating Resource array bean properties.

Can be used with any sort of location pattern (e.g. "/WEB-INF/*-context.xml"): Input patterns have to match the strategy implementation. This interface just specifies the conversion method rather than a specific pattern format.

This interface also suggests a new resource prefix "classpath*:" for all matching resources from the class path. Note that the resource location is expected to be a path without placeholders in this case (e.g. "/beans.xml"); JAR files or classes directories can contain multiple files of the same name.

Field Summary
 String CLASSPATH_ALL_URL_PREFIX    Pseudo URL prefix for all matching resources from the class path: "classpath*:" This differs from ResourceLoader's classpath URL prefix in that it retrieves all matching resources for a given name (e.g. "/beans.xml"), for example in the root of all deployed JAR files.
    Also see:
    org.springframework.core.io.ResourceLoader#CLASSPATH_URL_PREFIX
 
Method from org.springframework.core.io.support.ResourcePatternResolver Summary:
getResources
Method from org.springframework.core.io.support.ResourcePatternResolver Detail:
 public Resource[] getResources(String locationPattern) throws IOException
    Resolve the given location pattern into Resource objects.

    Overlapping resource entries that point to the same physical resource should be avoided, as far as possible. The result should have set semantics.