|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.pipeline.stage.BaseStage
org.apache.commons.pipeline.stage.HttpFileDownloadStage
public class HttpFileDownloadStage
This Stage provides the
functionality needed to retrieve data from an HTTP URL. Multipart responses
are not yet supported.
| Field Summary |
|---|
| Fields inherited from class org.apache.commons.pipeline.stage.BaseStage |
|---|
context |
| Constructor Summary | |
|---|---|
HttpFileDownloadStage()
|
|
HttpFileDownloadStage(java.lang.String workDir)
Creates a new HttpFileDownloadStage which will download files to the specified work directory. |
|
| Method Summary | |
|---|---|
java.lang.String |
getWorkDir()
Returns the name of the file download directory. |
java.net.URL |
handleRedirects(java.net.URL url)
Follows redirects from the specified URL and recursively returns the destination URL. |
void |
process(java.lang.Object obj)
Removes a java.net.URL (an HTTP URL) or string representing a URL from the input queue, and then retrieves the data at that URL and stores it in a temporary file. |
void |
setWorkDir(java.lang.String workDir)
Sets the working directory for the file download. |
| Methods inherited from class org.apache.commons.pipeline.stage.BaseStage |
|---|
emit, emit, init, postprocess, preprocess, release |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HttpFileDownloadStage()
public HttpFileDownloadStage(java.lang.String workDir)
workDir - the path to which files will be downloaded.| Method Detail |
|---|
public void process(java.lang.Object obj)
throws StageException
setWorkDir(), or to the system default
temporary directory if no work directory is set.
process in interface Stageprocess in class BaseStageobj - The URL from which to download data.
java.lang.IllegalArgumentException - if the parameter obj is not a string or
an instance of URL.
StageException - if there is an error retrieving data from the
URL specified.public void setWorkDir(java.lang.String workDir)
public java.lang.String getWorkDir()
public java.net.URL handleRedirects(java.net.URL url)
throws java.io.IOException,
java.net.MalformedURLException
java.io.IOException
java.net.MalformedURLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||