|
||||||||||
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.URLSourceFactory
public class URLSourceFactory
A factory for a URL
wrapper
Field Summary |
---|
Fields inherited from interface org.apache.excalibur.source.SourceFactory |
---|
ROLE |
Constructor Summary | |
---|---|
URLSourceFactory()
|
Method Summary | |
---|---|
protected Source |
createFileSource(String uri)
Create an file-based source. |
protected Source |
createURLSource(URL url,
Map parameters)
Create an URL-based source. |
Source |
getSource(String uri,
Map parameters)
Get a Source object. |
void |
parameterize(org.apache.avalon.framework.parameters.Parameters par)
Starting with JDK 1.5, accepts configuration parameters: connect-timeout used to set URLConnection.setConnectTimeout() read-timeout used to set URLConnection.setReadTimeout() |
void |
release(Source source)
Release a Source object. |
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 |
Constructor Detail |
---|
public URLSourceFactory()
Method Detail |
---|
public void parameterize(org.apache.avalon.framework.parameters.Parameters par) throws org.apache.avalon.framework.parameters.ParameterException
parameterize
in interface org.apache.avalon.framework.parameters.Parameterizable
org.apache.avalon.framework.parameters.ParameterException
protected Source createURLSource(URL url, Map parameters) throws MalformedURLException, IOException
URLSource
, but if another
implementation is needed, subclasses can override this method.
MalformedURLException
IOException
protected Source createFileSource(String uri) throws MalformedURLException, IOException
FileSource
, but if another
implementation is needed, subclasses can override this method.
MalformedURLException
IOException
public Source getSource(String uri, Map parameters) throws MalformedURLException, IOException
SourceFactory
Source
object.
The factory creates a new Source
object that can be used
by the application. However, when this source object is not needed
anymore it has to be released again using the SourceFactory.release(Source)
method. This is achieved by using SourceResolver.release(Source)
which
finds the appropriate SourceFactory
.
getSource
in interface SourceFactory
uri
- The URI to resolve - this URI includes the scheme.parameters
- additionnal named parameters (optionnal and can be null
)
that drive the creation of the Source
object. Each implementation
must specify what parameters it accepts.
IOException
- if the source couldn't be created for some reason.
MalformedURLException
SourceFactory.getSource(java.lang.String, java.util.Map)
public void release(Source source)
SourceFactory
Source
object.
release
in interface SourceFactory
source
- the source to release.SourceFactory.release(org.apache.excalibur.source.Source)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |