|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.excalibur.source.impl.SourceResolverImpl
public class SourceResolverImpl
This is the default implemenation of a SourceResolver
.
The source resolving is done relative to a base directory/URI (if
the given location is relative). This implementation looks for the
base URI in the Context
object of the "container" for the
"context-root" information. This information can either be a
File
object or a URL
object.
If the entry does not exist, the system property "user.dir" is used
as the base URI instead.
SourceResolver
Field Summary | |
---|---|
protected java.net.URL |
m_baseURL
The base URL |
protected org.apache.avalon.framework.service.ServiceSelector |
m_factorySelector
The special Source factories |
protected org.apache.avalon.framework.service.ServiceManager |
m_manager
The component m_manager |
Fields inherited from interface org.apache.excalibur.source.SourceResolver |
---|
METHOD, ROLE, URI_ENCODING, URI_PARAMETERS |
Constructor Summary | |
---|---|
SourceResolverImpl()
|
Method Summary | |
---|---|
private java.lang.String |
absolutize(SourceFactory factory,
java.lang.String baseURI,
java.lang.String systemID)
Makes an absolute URI based on a baseURI and a relative URI. |
void |
contextualize(org.apache.avalon.framework.context.Context context)
Get the context |
void |
dispose()
|
void |
release(Source source)
Releases a resolved resource |
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 |
service(org.apache.avalon.framework.service.ServiceManager manager)
Set the current ComponentLocator instance used by this
Composable . |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.apache.avalon.framework.service.ServiceManager m_manager
protected org.apache.avalon.framework.service.ServiceSelector m_factorySelector
protected java.net.URL m_baseURL
Constructor Detail |
---|
public SourceResolverImpl()
Method Detail |
---|
public void contextualize(org.apache.avalon.framework.context.Context context) throws org.apache.avalon.framework.context.ContextException
contextualize
in interface org.apache.avalon.framework.context.Contextualizable
org.apache.avalon.framework.context.ContextException
public void service(org.apache.avalon.framework.service.ServiceManager manager) throws org.apache.avalon.framework.service.ServiceException
ComponentLocator
instance used by this
Composable
.
service
in interface org.apache.avalon.framework.service.Serviceable
org.apache.avalon.framework.service.ServiceException
public void dispose()
dispose
in interface org.apache.avalon.framework.activity.Disposable
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.net.MalformedURLException
- if location
is malformed.
java.io.IOException
- if the source couldn't be created for some other reason.
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.net.MalformedURLException
- if location
is malformed.
java.io.IOException
- if the source couldn't be created for some other reason.
SourceException
private java.lang.String absolutize(SourceFactory factory, java.lang.String baseURI, java.lang.String systemID)
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 |