|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.pipeline.stage.FtpFileDownloadStage.FileSpec
public static class FtpFileDownloadStage.FileSpec
This class is used to specify a path and pattern of file for the FtpFileDownload
to retrieve. There are some parameters that can be configured in the filespec
that will control download behavior for recursive
searching, the
overwrite
of locally existing files, and to
ignoreExisting
files.
If a file already exists in the local directory, it is only replaced if
overwrite
is set to true
. If it is replaced, then the
filename is passed on to the next stage. Existing files are passed on to the
stage unless ignoreExisting
is true
. Note that the
ignoreExisting
flag is only used if overwrite
is
false
(it's assumed that if a file will be downloaded, then it
shouldn't be ignored).
Pseudocode to summarize the interaction of overwrite
and
ignoreExisting
:
if (file exists) { if (overwrite) { download file over existing local copy and pass it on to the next stage } else { if (ignoreExisting) { skip this file } else { pass existing file on to the next stage } } } else { download new file and pass it on to the next stage }
Nested Class Summary | |
---|---|
static class |
FtpFileDownloadStage.FileSpec.FileType
Enumeration of legal FTP file tranfer types |
Constructor Summary | |
---|---|
FtpFileDownloadStage.FileSpec()
|
Method Summary | |
---|---|
void |
addCriterion(FtpFileDownloadStage.Criterion crit)
Add a criterion to the set of criteria that must be matched for files to be downloaded |
String |
getFileType()
Returns the file type for the transfer. |
String |
getPath()
Getter for property path. |
String |
getPattern()
Deprecated. - not retrievable from criterion |
boolean |
isIgnoreExisting()
Getter for property ignoreExisting. |
boolean |
isOverwrite()
Getter for property overwrite. |
boolean |
isRecursive()
Returns whether or not the stage will recursively traverse the directory tree to find files. |
void |
setFileType(String fileType)
Sets the file type for the transfer. |
void |
setIgnoreExisting(boolean ignoreExisting)
Setter for property ignoreExisting. |
void |
setOverwrite(boolean overwrite)
Setter for property overwrite. |
void |
setPath(String path)
Setter for property path. |
void |
setPattern(String pattern)
Setter for property pattern. |
void |
setRecursive(boolean recursive)
Sets the flag determining whether or not the stage will recursively traverse the directory tree to find files. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FtpFileDownloadStage.FileSpec()
Method Detail |
---|
public String getPath()
public void setPath(String path)
path
- New value of property path.public String getPattern()
public void setPattern(String pattern)
pattern
- New value of property pattern.public void addCriterion(FtpFileDownloadStage.Criterion crit)
crit
- FtpFileDownloadStage.Criterion
used to match desired files for download, typically a filename patternpublic void setRecursive(boolean recursive)
recursive
- this value is true
to recursively search the remote directories for matches to
the criterion, false
to turn off recursive searchingpublic boolean isRecursive()
public void setFileType(String fileType)
fileType
- the FTP transfer type to use, "ascii
" or "binary
"public String getFileType()
public boolean isOverwrite()
false
, so existing local files will not be replaced by downloading
remote files. This flag should be set to true
if it is expected
that the remote file is periodically updated and the local file is and out of
date copy from a previous run of this pipeline.
public void setOverwrite(boolean overwrite)
overwrite
- New value of property overwrite.public boolean isIgnoreExisting()
false
, so existing files that aren't downloaded are still passed
on to the next stage.
public void setIgnoreExisting(boolean ignoreExisting)
ignoreExisting
- New value of property ignoreExisting.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |