|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.util.resource.AbsoluteResourceLocator
public class AbsoluteResourceLocator
A conservative ResourceLocator implementation that only resolves resources with absolute resource name paths. It may be used in two ways
This ResourceLocator is specifically NOT for loading resources from the Classpath. Use *Classpath*ResourceLocator class(es) for that purpose.
ResourceLocator
Constructor Summary | |
---|---|
AbsoluteResourceLocator()
Instantiate a locator for any resource present at the specified absolute resource path. |
|
AbsoluteResourceLocator(java.net.URI baseUri)
Instantiate a locator for resources residing underneath the specified base URI, and requested with absolute path. |
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 AbsoluteResourceLocator()
public AbsoluteResourceLocator(java.net.URI baseUri)
To restrict to any absolute paths within a URI base, use a URI path of
just "/", like new URI("http://acme.com/")
or
new File("/").toURI()
.
A rather non-intuitive aspect of Java file URIs, is that a trailing "/" will be truncated unless the item is present and is a directory... And also that resolution of URL paths ending with /, like "/home/blaine/info.txt/" will succeed and can read the file.
baseURI
- IMPORTANT: The whole purpose here is to specify
a path with an absolue path to validate against.
Therefore, to cover an entire web site, you must use
http://pub.admc.com/
, not
http://pub.admc.com
.
java.lang.IllegalArgumentException
- if the specified baseUri does not have
an absolue URI path, or is otherwise unacceptable.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 |