|
|||||||||||
| 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.HTTPClientSource
HTTP URL Source object, based on the Jakarta Commons HttpClient project.
| Field Summary | |
static java.lang.String |
CONTENT_LENGTH
Constant used when obtaining the Content-Length from HTTP Headers |
static java.lang.String |
CONTENT_TYPE
Constant used when obtaining the Content-Type from HTTP Headers |
static java.lang.String |
GET
Constant used for identifying GET requests. |
static java.lang.String |
LAST_MODIFIED
Constant used when obtaining the Last-Modified date from HTTP Headers |
static java.lang.String |
POST
Constant used for identifying POST requests. |
static java.lang.String |
PROXY_HOST
Constant used for configuring the proxy hostname. |
static java.lang.String |
PROXY_PORT
Constant used for configuring the proxy port number. |
| Constructor Summary | |
HTTPClientSource(java.lang.String uri,
java.util.Map parameters,
org.apache.commons.httpclient.HttpState httpState)
Constructor, creates a new HTTPClientSource instance. |
|
| Method Summary | |
boolean |
canCancel(java.io.OutputStream stream)
Method to determine whether writing to the supplied OutputStream (which must be that returned from getOutputStream()) can
be cancelled |
void |
cancel(java.io.OutputStream stream)
Cancels any data sent to the OutputStream returned by
getOutputStream(). |
void |
delete()
Deletes the referenced resource. |
protected int |
executeMethod(org.apache.commons.httpclient.HttpMethod method)
Executes a particular HttpMethod and updates internal
data storage. |
boolean |
exists()
Method to ascertain whether the given resource actually exists. |
long |
getContentLength()
Obtain the content length of the referenced resource. |
java.io.InputStream |
getInputStream()
Method to obtain an InputStream to read the response
from the server. |
long |
getLastModified()
Get the last modification date of this source. |
java.lang.String |
getMimeType()
Obtain the mime-type for the referenced resource. |
java.io.OutputStream |
getOutputStream()
Obtain an OutputStream to write to. |
java.lang.String |
getScheme()
Return the URI scheme identifier, ie. |
java.lang.String |
getURI()
Obtain the absolute URI this Source object references. |
SourceValidity |
getValidity()
Obtain a SourceValidity object. |
void |
initialize()
Initializes this HTTPClientSource instance. |
void |
parameterize(Parameters params)
Parameterizes this HTTPClientSource instance. |
void |
refresh()
Refreshes this 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 |
| Field Detail |
public static final java.lang.String POST
public static final java.lang.String GET
public static final java.lang.String PROXY_HOST
public static final java.lang.String PROXY_PORT
public static final java.lang.String CONTENT_TYPE
public static final java.lang.String CONTENT_LENGTH
public static final java.lang.String LAST_MODIFIED
| Constructor Detail |
public HTTPClientSource(java.lang.String uri,
java.util.Map parameters,
org.apache.commons.httpclient.HttpState httpState)
throws java.lang.Exception
HTTPClientSource instance.
uri - URIparameters - contextual parameters passed to this instance
java.lang.Exception - if an error occurs| Method Detail |
public void parameterize(Parameters params)
throws ParameterException
HTTPClientSource instance.
parameterize in interface Parameterizableparams - a Parameters instance.
ParameterException - if an error occurs
public void initialize()
throws java.lang.Exception
HTTPClientSource instance.
initialize in interface Initializablejava.lang.Exception - if an error occurs
protected int executeMethod(org.apache.commons.httpclient.HttpMethod method)
throws java.io.IOException
HttpMethod and updates internal
data storage.
method - HttpMethod to execute
java.io.IOException - if an error occurspublic boolean exists()
exists in interface Sourcetrue if the resource pointed to by the
URI during construction exists, false
otherwise.
public java.io.InputStream getInputStream()
throws java.io.IOException,
SourceNotFoundException
InputStream to read the response
from the server.
getInputStream in interface SourceInputStream containing data sent from the server.
java.io.IOException - if some I/O problem occurs.
SourceNotFoundException - if the source doesn't exist.public java.lang.String getURI()
Source object references.
getURI in interface SourceString object references.public java.lang.String getScheme()
getScheme in interface Sourcepublic SourceValidity getValidity()
SourceValidity object.
getValidity in interface SourceSourceValidity object, or
null if this is not possible.public void refresh()
Source object.
refresh in interface Sourcepublic java.lang.String getMimeType()
getMimeType in interface Sourcepublic long getContentLength()
getContentLength in interface Sourcepublic long getLastModified()
getLastModified in interface Source0 if unknown.
public java.io.OutputStream getOutputStream()
throws java.io.IOException
OutputStream to write to. The OutputStream
returned actually references a temporary local file, which will
be written to the server upon closing.
The returned stream must be closed or cancelled by the calling code.
getOutputStream in interface ModifiableSourceOutputStream instance
java.io.IOException - if an error occurs
public void delete()
throws SourceException
delete in interface ModifiableSourceSourceException - if an error occurspublic boolean canCancel(java.io.OutputStream stream)
getOutputStream()) can
be cancelled
canCancel in interface ModifiableSource
public void cancel(java.io.OutputStream stream)
throws java.io.IOException
OutputStream returned by
getOutputStream().
After calling this method, the supplied OutputStream
should no longer be used.
cancel in interface ModifiableSourcejava.io.IOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||