|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.excalibur.source.impl.AbstractSourceResolver
This is an abstract implementation of a SourceResolver
.
The source resolving is done relative to a base directory/URI (if
the given location is relative). The base directory/URI has to be set
using setBaseURL(URL)
.
A subclass should implement getSourceFactory(String)
and
releaseSourceFactory(SourceFactory)
if required.
To support various logging frameworks, the subclass should implement the
isDebugEnabled()
and the debug(String)
method.
SourceResolver
Field Summary | |
protected java.net.URL |
m_baseURL
The base URL |
Fields inherited from interface org.apache.excalibur.source.SourceResolver |
METHOD, ROLE, URI_ENCODING, URI_PARAMETERS |
Constructor Summary | |
AbstractSourceResolver()
|
Method Summary | |
protected void |
debug(java.lang.String text)
|
protected abstract SourceFactory |
getSourceFactory(java.lang.String protocol)
|
protected boolean |
isDebugEnabled()
|
void |
release(Source source)
Releases a resolved resource |
protected void |
releaseSourceFactory(SourceFactory factory)
|
Source |
resolveURI(java.lang.String location)
Get a Source object. |
Source |
resolveURI(java.lang.String location,
java.lang.String baseURI,
java.util.Map parameters)
Get a Source object. |
void |
setBaseURL(java.net.URL baseurl)
Set the base url. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.net.URL m_baseURL
Constructor Detail |
public AbstractSourceResolver()
Method Detail |
public void setBaseURL(java.net.URL baseurl)
protected boolean isDebugEnabled()
protected void debug(java.lang.String text)
protected abstract SourceFactory getSourceFactory(java.lang.String protocol)
protected void releaseSourceFactory(SourceFactory factory)
public Source resolveURI(java.lang.String location) throws java.net.MalformedURLException, java.io.IOException, SourceException
Source
object.
resolveURI
in interface SourceResolver
SourceNotFoundException
- if the source cannot be found
java.io.IOException
- if the source couldn't be created for some other reason.
java.net.MalformedURLException
- if location
is malformed.
SourceException
public Source resolveURI(java.lang.String location, java.lang.String baseURI, java.util.Map parameters) throws java.net.MalformedURLException, java.io.IOException, SourceException
Source
object.
resolveURI
in interface SourceResolver
location
- - the URI to resolve. If this is relative it is either
resolved relative to the base parameter (if not null)
or relative to a base setting of the source resolver
itself.baseURI
- - a base URI for resolving relative locations. This
is optional and can be null
.parameters
- - Additional parameters for the URI. The parameters
are specific to the used scheme.
SourceNotFoundException
- if the source cannot be found
java.io.IOException
- if the source couldn't be created for some other reason.
java.net.MalformedURLException
- if location
is malformed.
SourceException
public void release(Source source)
release
in interface SourceResolver
source
- the source to release
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |