|
||||||||||
| 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(String workDir)
Creates a new HttpFileDownloadStage which will download files to the specified work directory. |
|
| Method Summary | |
|---|---|
String |
getWorkDir()
Returns the name of the file download directory. |
URL |
handleRedirects(URL url)
Follows redirects from the specified URL and recursively returns the destination URL. |
void |
process(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(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(String workDir)
workDir - the path to which files will be downloaded.| Method Detail |
|---|
public void process(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.
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(String workDir)
public String getWorkDir()
public URL handleRedirects(URL url)
throws IOException,
MalformedURLException
IOException
MalformedURLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||