Skip navigation links
org.apache.myfaces.trinidad.resource
Class RegexResourceLoader
java.lang.Object
org.apache.myfaces.trinidad.resource.ResourceLoader
org.apache.myfaces.trinidad.resource.RegexResourceLoader
-
public class RegexResourceLoader
- extends ResourceLoader
A resource loader implementation which loads resources by pattern matching the requested resource path to a registered resource loader. Change history 2006-08-01: -= Simon Lessard =- Changed to use a list of entry rather than a dual typed one to add more type safety with minimal memory overhaul and get a really small performance gain.
| Method Summary |
protected void |
deregister(java.lang.String regex)
Deregisters a resource loader by regular expression. |
protected java.net.URL |
findResource(java.lang.String path)
Finds the resource with the given name. |
protected void |
register(java.lang.String regex, ResourceLoader loader)
Registers a resource loader by regular expression. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
RegexResourceLoader
public RegexResourceLoader()
- Creates a new RegexResourceLoader.
findResource
protected java.net.URL findResource(java.lang.String path)
throws java.io.IOException
- Description copied from class:
ResourceLoader
- Finds the resource with the given name. Resource loader implementations should override this method to specify where to find resources.
-
- Overrides:
findResource in class ResourceLoader
-
- Parameters:
path - The resource name
- Returns:
- A URL object for reading the resource, or null if the resource could not be found
- Throws:
java.io.IOException
register
protected void register(java.lang.String regex,
ResourceLoader loader)
- Registers a resource loader by regular expression.
-
- Parameters:
regex - the regular expression to match
loader - the resource loader to use for matching paths
deregister
protected void deregister(java.lang.String regex)
- Deregisters a resource loader by regular expression.
-
- Parameters:
regex - the regular expression to remove
Skip navigation links
Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.