|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.util.resource.RelativeResourceLocator
public class RelativeResourceLocator
A conservative ResourceLocator implementation that adds to the search path just the parent directory of the specified URI, and it is only used for resources requested with relative paths.
Relative paths may have multiple segments, like a/b/c.txt
,
they just can't be absolute, like /a/b.c.txt
.
It is basic behavior of relative URL lookups that a lookup of "x" relative to "/a/b" would match both "/a/x" and "/a/b/x".
ResourceLocator
Constructor Summary | |
---|---|
RelativeResourceLocator(java.net.URI baseUri)
|
|
RelativeResourceLocator(java.net.URL baseUrl)
Convenience wrapper |
Method Summary | |
---|---|
java.net.URL |
locateResource(java.lang.String resourceName)
Locates a resource according to the strategy of the resource locator implementation (subclass). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RelativeResourceLocator(java.net.URI baseUri)
public RelativeResourceLocator(java.net.URL baseUrl) throws java.net.URISyntaxException
java.net.URISyntaxException
- if input URL is invalid.
Only doing this due to Java language contraints.
Would prefer to throw an unchecked exception for this.RelativeResourceLocator(URI)
Method Detail |
---|
public java.net.URL locateResource(java.lang.String resourceName)
ResourceLocator
locateResource
in interface ResourceLocator
resourceName
- the name of the resource to locate; it this is a path it must be slash separated (no backslashes)
SimpleResourceLocator
,
MultiFormatResourceLocator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |