public class DefaultResourceFinder extends java.lang.Object implements ResourceFinder
ResourceFinder interface. Resolves
URIs relative to a base URI specified at the time of construction.| Constructor and Description |
|---|
DefaultResourceFinder()
Default constructor: resolve relative URIs against current working directory.
|
DefaultResourceFinder(java.io.File relativeDir,
java.io.File absoluteDir)
Constructor: resolve relative URIs against specified directory.
|
| Modifier and Type | Method and Description |
|---|---|
java.net.URI |
getBaseResourceURI() |
java.io.InputStream |
openResource(java.net.URI uri)
Obtain an input stream to the resource at the given URI.
|
java.net.URI |
resolve(java.net.URI parent,
java.net.URI child) |
public DefaultResourceFinder()
public DefaultResourceFinder(java.io.File relativeDir,
java.io.File absoluteDir)
relativeDir - base path for relative URLs.absoluteDir - base path for absolute URLs.public java.io.InputStream openResource(java.net.URI uri)
throws java.net.MalformedURLException,
java.io.IOException
ResourceFinderopenResource in interface ResourceFinderuri - resource URInull if the resource is not foundjava.net.MalformedURLException - in case of invalid URIjava.io.IOException - in case of read errorpublic java.net.URI getBaseResourceURI()
getBaseResourceURI in interface ResourceFinderpublic java.net.URI resolve(java.net.URI parent,
java.net.URI child)
resolve in interface ResourceFinder