public class ResourceResolver extends Object
| Constructor and Description |
|---|
ResourceResolver()
Creates a new ResourceResolver that doesn't fail if the resource is missing.
|
ResourceResolver(boolean failOnMissingResource)
Creates a new ResourceResolver that will fail with an
AssertionError if the resource can not
be located. |
| Modifier and Type | Method and Description |
|---|---|
URL |
resolve(String resource)
Resolves a URL of the resource specified.
|
URL |
resolve(String resource,
Class consumer)
Resolves a URL of the resource specified using the provided class as hint to start the search.
|
public ResourceResolver()
public ResourceResolver(boolean failOnMissingResource)
AssertionError if the resource can not
be located.failOnMissingResource - set to true if an exception should be thrown in case the resource is not foundpublic URL resolve(String resource)
resource - the resource to be resolvedAssertionError - If the resolver is configured to fail on missing resourcepublic URL resolve(String resource, Class consumer)
resource - the path the resource. The path can be either absolute or relative to the consumers location.consumer - the consumer class of the resource. It's classloader is used for the lookup and it's location is used
as reference point for resolving relative path namesCopyright © 2016 DevCon5 GmbH. All rights reserved.