|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.pipeline.stage.BaseStage org.apache.commons.pipeline.stage.FtpFileDownloadStage
public class FtpFileDownloadStage
This Stage
provides the
functionality needed to retrieve data from an FTP URL. Multipart responses
are not yet supported.
Nested Class Summary | |
---|---|
static interface |
FtpFileDownloadStage.Criterion
This class is used to specify a criterion that the downloaded file must satisfy. |
static class |
FtpFileDownloadStage.FileDateMatchCriterion
Matches files by matching their filesystem timestamp to a date range. |
static class |
FtpFileDownloadStage.FileNameMatchCriterion
Matches file names based upon the Java regex supplied in the constructor. |
static class |
FtpFileDownloadStage.FileSpec
This class is used to specify a path and pattern of file for the FtpFileDownload to retrieve. |
Field Summary |
---|
Fields inherited from class org.apache.commons.pipeline.stage.BaseStage |
---|
context |
Constructor Summary | |
---|---|
FtpFileDownloadStage()
Default constructor - creates work directory in /tmp |
|
FtpFileDownloadStage(String workDir)
Constructor specifying work directory. |
Method Summary | |
---|---|
String |
getHost()
Getter for property host. |
int |
getPort()
Getter for property port. |
String |
getUser()
Getter for property user. |
String |
getWorkDir()
Returns the name of the file download directory. |
void |
preprocess()
Creates the download directory workDir uf it does
not exist and makes a connection to the remote FTP server. |
void |
process(Object obj)
Retrieves files that match the specified FileSpec from the FTP server and stores them in the work directory. |
void |
release()
Disconnects from FTP server. |
void |
setHost(String host)
Setter for property host. |
void |
setPassword(String password)
Setter for property password. |
void |
setPort(int port)
Setter for property port. |
void |
setUser(String user)
Setter for property user. |
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FtpFileDownloadStage()
public FtpFileDownloadStage(String workDir)
workDir
- local directory in which to store downloaded filesMethod Detail |
---|
public void preprocess() throws StageException
workDir
uf it does
not exist and makes a connection to the remote FTP server.
preprocess
in interface Stage
preprocess
in class BaseStage
StageException
- if a connection to the remote FTP server cannot be established, or the login to
the remote system failsStage.preprocess()
public void process(Object obj) throws StageException
process
in interface Stage
process
in class BaseStage
obj
- incoming FtpFileDownloadStage.FileSpec
that indicates the file to download along with some flags to
control the download behavior
StageException
- if there are errors navigating the remote directory structure or file download
failspublic void release()
release
in interface Stage
release
in class BaseStage
Stage.release()
public void setWorkDir(String workDir)
workDir
- local directory to receive file downloadspublic String getWorkDir()
public String getHost()
public void setHost(String host)
host
- New value of property host.public String getUser()
public void setUser(String user)
user
- New value of property user.public void setPassword(String password)
password
- New value of property password.public int getPort()
public void setPort(int port)
port
- New value of property port.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |