Class FTP
- java.lang.Object
- 
- org.apache.tools.ant.ProjectComponent
- 
- org.apache.tools.ant.Task
- 
- org.apache.tools.ant.taskdefs.optional.net.FTP
 
 
 
- 
- All Implemented Interfaces:
- java.lang.Cloneable
 
 public class FTP extends Task Basic FTP client. Performs the following actions:- send - send files to a remote server. This is the default action.
- get - retrieve files from a remote server.
- del - delete files from a remote server.
- list - create a file listing.
- chmod - change unix file permissions.
- rmdir - remove directories, if empty, from a remote server.
 - Since:
- Ant 1.3
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classFTP.Actionan action to perform, one of "send", "put", "recv", "get", "del", "delete", "list", "mkdir", "chmod", "rmdir"protected classFTP.FTPDirectoryScannerinternal class allowing to read the contents of a remote file system using the FTP protocol used in particular for ftp get operations differences with DirectoryScanner "" (the root of the fileset) is never included in the included directories followSymlinks defaults to falseprotected static classFTP.FTPFileProxyinternal class providing a File-like interface to some of the information available from the FTP serverstatic classFTP.FTPSystemTypeone of the valid system type keys recognized by the systemTypeKey attribute.static classFTP.Granularityrepresents one of the valid timestamp adjustment values recognized by thetimestampGranularityattribute.static classFTP.LanguageCodeEnumerated class for languages.
 - 
Field SummaryFields Modifier and Type Field Description protected static java.lang.String[]ACTION_STRSprotected static java.lang.String[]ACTION_TARGET_STRSprotected static intCHMODprotected static java.lang.String[]COMPLETED_ACTION_STRSstatic intDEFAULT_FTP_PORTDefault port for FTPprotected static intDEL_FILESprotected static intGET_FILESprotected static intLIST_FILESprotected static intMK_DIRprotected static intRM_DIRprotected static intSEND_FILESprotected static intSITE_CMD- 
Fields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
 
- 
 - 
Constructor SummaryConstructors Constructor Description FTP()
 - 
Method SummaryModifier and Type Method Description voidaddFileset(FileSet set)A set of files to upload or downloadprotected voidcheckAttributes()Checks to see that all required parameters are set.protected voidcreateParents(org.apache.commons.net.ftp.FTPClient ftp, java.lang.String filename)Creates all parent directories specified in a complete relative pathname.protected voiddelFile(org.apache.commons.net.ftp.FTPClient ftp, java.lang.String filename)Delete a file from the remote host.protected voiddoSiteCommand(org.apache.commons.net.ftp.FTPClient ftp, java.lang.String theCMD)Sends a site command to the ftp servervoidexecute()Runs the task.protected voidexecuteRetryable(RetryHandler h, Retryable r, java.lang.String descr)Executable a retryable object.java.lang.StringgetDefaultDateFormatConfig()protected voidgetFile(org.apache.commons.net.ftp.FTPClient ftp, java.lang.String dir, java.lang.String filename)Retrieve a single file from the remote host.java.lang.StringgetRecentDateFormatConfig()java.lang.StringgetServerLanguageCodeConfig()java.lang.StringgetServerTimeZoneConfig()java.lang.StringgetShortMonthNamesConfig()java.lang.StringgetSystemTypeKey()protected booleanisUpToDate(org.apache.commons.net.ftp.FTPClient ftp, java.io.File localFile, java.lang.String remoteFile)Checks to see if the remote file is current as compared with the local file.protected voidlistFile(org.apache.commons.net.ftp.FTPClient ftp, java.io.BufferedWriter bw, java.lang.String filename)List information about a single file from the remote host.voidlog(java.lang.String msg, int level)protected voidmakeRemoteDir(org.apache.commons.net.ftp.FTPClient ftp, java.lang.String dir)Create the specified directory on the remote host.protected java.lang.StringresolveFile(java.lang.String file)Correct a file path to correspond to the remote host requirements.protected voidrmDir(org.apache.commons.net.ftp.FTPClient ftp, java.lang.String dirname)Delete a directory, if empty, from the remote host.protected voidsendFile(org.apache.commons.net.ftp.FTPClient ftp, java.lang.String dir, java.lang.String filename)Sends a single file to the remote host.voidsetAccount(java.lang.String pAccount)Sets the login account to use on the specified server.voidsetAction(java.lang.String action)Deprecated.since 1.5.x.voidsetAction(FTP.Action action)Sets the FTP action to be taken.voidsetBinary(boolean binary)If true, uses binary mode, otherwise text mode (default is binary).voidsetChmod(java.lang.String theMode)Sets the file permission mode (Unix only) for files sent to the server.voidsetDataTimeout(int dataTimeout)Sets the timeout on the data connection in milliseconds.voidsetDefaultDateFormatConfig(java.lang.String defaultDateFormat)Sets the defaultDateFormatConfig attribute.voidsetDepends(boolean depends)Set to true to transmit only files that are new or changed from their remote counterparts.voidsetEnableRemoteVerification(boolean b)Whether to verify that data and control connections are connected to the same remote host.voidsetIgnoreNoncriticalErrors(boolean ignoreNoncriticalErrors)set the flag to skip errors on directory creation.voidsetInitialSiteCommand(java.lang.String initialCommand)Sets the initialSiteCommand attribute.voidsetListing(java.io.File listing)The output file for the "list" action.voidsetNewer(boolean newer)A synonym fordepends.voidsetPassive(boolean passive)Specifies whether to use passive mode.voidsetPassword(java.lang.String password)Sets the login password for the given user id.voidsetPort(int port)Sets the FTP port used by the remote server.voidsetPreserveLastModified(boolean preserveLastModified)Set to true to preserve modification times for "gotten" files.voidsetRecentDateFormatConfig(java.lang.String recentDateFormat)Sets the recentDateFormatConfig attribute.voidsetRemotedir(java.lang.String dir)Sets the remote directory where files will be placed.voidsetRetriesAllowed(java.lang.String retriesAllowed)Defines how many times to retry executing FTP command before giving up.voidsetSeparator(java.lang.String separator)Sets the remote file separator character.voidsetServer(java.lang.String server)Sets the FTP server to send files to.voidsetServerLanguageCodeConfig(FTP.LanguageCode serverLanguageCode)Sets the serverLanguageCode attribute.voidsetServerTimeZoneConfig(java.lang.String serverTimeZoneId)Sets the serverTimeZoneConfig attribute.voidsetShortMonthNamesConfig(java.lang.String shortMonthNames)Sets the shortMonthNamesConfig attributevoidsetSiteCommand(java.lang.String siteCommand)Sets the siteCommand attribute.voidsetSkipFailedTransfers(boolean skipFailedTransfers)If true, enables unsuccessful file put, delete and get operations to be skipped with a warning and the remainder of the files still transferred.voidsetSystemTypeKey(FTP.FTPSystemType systemKey)Sets the systemTypeKey attribute.voidsetTimeDiffAuto(boolean timeDiffAuto)"true" to find out automatically the time difference between local and remote machine.voidsetTimeDiffMillis(long timeDiffMillis)number of milliseconds to add to the time on the remote machine to get the time on the local machine.voidsetTimestampGranularity(FTP.Granularity timestampGranularity)Sets the timestampGranularity attributevoidsetUmask(java.lang.String theUmask)Sets the default mask for file creation on a unix server.voidsetUserid(java.lang.String userid)Sets the login user id to use on the specified server.voidsetVerbose(boolean verbose)Set to true to receive notification about each file as it is transferred.voidsetWakeUpTransferInterval(int wakeUpTransferInterval)Sets the time interval when we should automatically call a command triggering a transfer The parameter is in secondsprotected voidtransferFiles(org.apache.commons.net.ftp.FTPClient ftp)Sends all files specified by the configured filesets to the remote server.protected inttransferFiles(org.apache.commons.net.ftp.FTPClient ftp, FileSet fs)For each file in the fileset, do the appropriate action: send, get, delete, or list.- 
Methods inherited from class org.apache.tools.ant.TaskbindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 - 
Methods inherited from class org.apache.tools.ant.ProjectComponentclone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
- 
 
- 
- 
- 
Field Detail- 
SEND_FILESprotected static final int SEND_FILES - See Also:
- Constant Field Values
 
 - 
GET_FILESprotected static final int GET_FILES - See Also:
- Constant Field Values
 
 - 
DEL_FILESprotected static final int DEL_FILES - See Also:
- Constant Field Values
 
 - 
LIST_FILESprotected static final int LIST_FILES - See Also:
- Constant Field Values
 
 - 
MK_DIRprotected static final int MK_DIR - See Also:
- Constant Field Values
 
 - 
CHMODprotected static final int CHMOD - See Also:
- Constant Field Values
 
 - 
RM_DIRprotected static final int RM_DIR - See Also:
- Constant Field Values
 
 - 
SITE_CMDprotected static final int SITE_CMD - See Also:
- Constant Field Values
 
 - 
DEFAULT_FTP_PORTpublic static final int DEFAULT_FTP_PORT Default port for FTP- See Also:
- Constant Field Values
 
 - 
ACTION_STRSprotected static final java.lang.String[] ACTION_STRS 
 - 
COMPLETED_ACTION_STRSprotected static final java.lang.String[] COMPLETED_ACTION_STRS 
 - 
ACTION_TARGET_STRSprotected static final java.lang.String[] ACTION_TARGET_STRS 
 
- 
 - 
Method Detail- 
setRemotedirpublic void setRemotedir(java.lang.String dir) Sets the remote directory where files will be placed. This may be a relative or absolute path, and must be in the path syntax expected by the remote server. No correction of path syntax will be performed.- Parameters:
- dir- the remote directory name.
 
 - 
setServerpublic void setServer(java.lang.String server) Sets the FTP server to send files to.- Parameters:
- server- the remote server name.
 
 - 
setPortpublic void setPort(int port) Sets the FTP port used by the remote server.- Parameters:
- port- the port on which the remote server is listening.
 
 - 
setUseridpublic void setUserid(java.lang.String userid) Sets the login user id to use on the specified server.- Parameters:
- userid- remote system userid.
 
 - 
setPasswordpublic void setPassword(java.lang.String password) Sets the login password for the given user id.- Parameters:
- password- the password on the remote system.
 
 - 
setAccountpublic void setAccount(java.lang.String pAccount) Sets the login account to use on the specified server.- Parameters:
- pAccount- the account name on remote system
- Since:
- Ant 1.7
 
 - 
setBinarypublic void setBinary(boolean binary) If true, uses binary mode, otherwise text mode (default is binary).- Parameters:
- binary- if true use binary mode in transfers.
 
 - 
setPassivepublic void setPassive(boolean passive) Specifies whether to use passive mode. Set to true if you are behind a firewall and cannot connect without it. Passive mode is disabled by default.- Parameters:
- passive- true is passive mode should be used.
 
 - 
setVerbosepublic void setVerbose(boolean verbose) Set to true to receive notification about each file as it is transferred.- Parameters:
- verbose- true if verbose notifications are required.
 
 - 
setNewerpublic void setNewer(boolean newer) A synonym fordepends. Set to true to transmit only new or changed files. See the related attributes timediffmillis and timediffauto.- Parameters:
- newer- if true only transfer newer files.
 
 - 
setTimeDiffMillispublic void setTimeDiffMillis(long timeDiffMillis) number of milliseconds to add to the time on the remote machine to get the time on the local machine. use in conjunction withnewer- Parameters:
- timeDiffMillis- number of milliseconds
- Since:
- ant 1.6
 
 - 
setTimeDiffAutopublic void setTimeDiffAuto(boolean timeDiffAuto) "true" to find out automatically the time difference between local and remote machine. This requires right to create and delete a temporary file in the remote directory.- Parameters:
- timeDiffAuto- true = find automatically the time diff
- Since:
- ant 1.6
 
 - 
setPreserveLastModifiedpublic void setPreserveLastModified(boolean preserveLastModified) Set to true to preserve modification times for "gotten" files.- Parameters:
- preserveLastModified- if true preserver modification times.
 
 - 
setDependspublic void setDepends(boolean depends) Set to true to transmit only files that are new or changed from their remote counterparts. The default is to transmit all files.- Parameters:
- depends- if true only transfer newer files.
 
 - 
setSeparatorpublic void setSeparator(java.lang.String separator) Sets the remote file separator character. This normally defaults to the Unix standard forward slash, but can be manually overridden using this call if the remote server requires some other separator. Only the first character of the string is used.- Parameters:
- separator- the file separator on the remote system.
 
 - 
setChmodpublic void setChmod(java.lang.String theMode) Sets the file permission mode (Unix only) for files sent to the server.- Parameters:
- theMode- unix style file mode for the files sent to the remote system.
 
 - 
setUmaskpublic void setUmask(java.lang.String theUmask) Sets the default mask for file creation on a unix server.- Parameters:
- theUmask- unix style umask for files created on the remote server.
 
 - 
addFilesetpublic void addFileset(FileSet set) A set of files to upload or download- Parameters:
- set- the set of files to be added to the list of files to be transferred.
 
 - 
setAction@Deprecated public void setAction(java.lang.String action) throws BuildExceptionDeprecated.since 1.5.x. setAction(String) is deprecated and is replaced with setAction(FTP.Action) to make Ant's Introspection mechanism do the work and also to encapsulate operations on the type in its own class.Sets the FTP action to be taken. Currently accepts "put", "get", "del", "mkdir", "chmod", "list", and "site".- Parameters:
- action- the FTP action to be performed.
- Throws:
- BuildException- if the action is not a valid action.
 
 - 
setActionpublic void setAction(FTP.Action action) throws BuildException Sets the FTP action to be taken. Currently accepts "put", "get", "del", "mkdir", "chmod", "list", and "site".- Parameters:
- action- the FTP action to be performed.
- Throws:
- BuildException- if the action is not a valid action.
 
 - 
setListingpublic void setListing(java.io.File listing) The output file for the "list" action. This attribute is ignored for any other actions.- Parameters:
- listing- file in which to store the listing.
 
 - 
setSkipFailedTransferspublic void setSkipFailedTransfers(boolean skipFailedTransfers) If true, enables unsuccessful file put, delete and get operations to be skipped with a warning and the remainder of the files still transferred.- Parameters:
- skipFailedTransfers- true if failures in transfers are ignored.
 
 - 
setIgnoreNoncriticalErrorspublic void setIgnoreNoncriticalErrors(boolean ignoreNoncriticalErrors) set the flag to skip errors on directory creation. (and maybe later other server specific errors)- Parameters:
- ignoreNoncriticalErrors- true if non-critical errors should not cause a failure.
 
 - 
setSystemTypeKeypublic void setSystemTypeKey(FTP.FTPSystemType systemKey) Sets the systemTypeKey attribute. Method for settingFTPClientConfigremote system key.- Parameters:
- systemKey- the key to be set - BUT if blank the default value of null (which signifies "autodetect") will be kept.
- See Also:
- FTPClientConfig
 
 - 
setDefaultDateFormatConfigpublic void setDefaultDateFormatConfig(java.lang.String defaultDateFormat) Sets the defaultDateFormatConfig attribute.- Parameters:
- defaultDateFormat- configuration to be set, unless it is null or empty string, in which case ignored.
- See Also:
- FTPClientConfig
 
 - 
setRecentDateFormatConfigpublic void setRecentDateFormatConfig(java.lang.String recentDateFormat) Sets the recentDateFormatConfig attribute.- Parameters:
- recentDateFormat- configuration to be set, unless it is null or empty string, in which case ignored.
- See Also:
- FTPClientConfig
 
 - 
setServerLanguageCodeConfigpublic void setServerLanguageCodeConfig(FTP.LanguageCode serverLanguageCode) Sets the serverLanguageCode attribute.- Parameters:
- serverLanguageCode- configuration to be set, unless it is null or empty string, in which case ignored.
- See Also:
- FTPClientConfig
 
 - 
setServerTimeZoneConfigpublic void setServerTimeZoneConfig(java.lang.String serverTimeZoneId) Sets the serverTimeZoneConfig attribute.- Parameters:
- serverTimeZoneId- configuration to be set, unless it is null or empty string, in which case ignored.
- See Also:
- FTPClientConfig
 
 - 
setShortMonthNamesConfigpublic void setShortMonthNamesConfig(java.lang.String shortMonthNames) Sets the shortMonthNamesConfig attribute- Parameters:
- shortMonthNames- configuration to be set, unless it is null or empty string, in which case ignored.
- See Also:
- FTPClientConfig
 
 - 
setRetriesAllowedpublic void setRetriesAllowed(java.lang.String retriesAllowed) Defines how many times to retry executing FTP command before giving up. Default is 0 - try once and if failure then give up.- Parameters:
- retriesAllowed- number of retries to allow. -1 means keep trying forever. "forever" may also be specified as a synonym for -1.
 
 - 
getSystemTypeKeypublic java.lang.String getSystemTypeKey() - Returns:
- Returns the systemTypeKey.
 
 - 
getDefaultDateFormatConfigpublic java.lang.String getDefaultDateFormatConfig() - Returns:
- Returns the defaultDateFormatConfig.
 
 - 
getRecentDateFormatConfigpublic java.lang.String getRecentDateFormatConfig() - Returns:
- Returns the recentDateFormatConfig.
 
 - 
getServerLanguageCodeConfigpublic java.lang.String getServerLanguageCodeConfig() - Returns:
- Returns the serverLanguageCodeConfig.
 
 - 
getServerTimeZoneConfigpublic java.lang.String getServerTimeZoneConfig() - Returns:
- Returns the serverTimeZoneConfig.
 
 - 
getShortMonthNamesConfigpublic java.lang.String getShortMonthNamesConfig() - Returns:
- Returns the shortMonthNamesConfig.
 
 - 
setTimestampGranularitypublic void setTimestampGranularity(FTP.Granularity timestampGranularity) Sets the timestampGranularity attribute- Parameters:
- timestampGranularity- The timestampGranularity to set.
 
 - 
setSiteCommandpublic void setSiteCommand(java.lang.String siteCommand) Sets the siteCommand attribute. This attribute names the command that will be executed if the action is "site".- Parameters:
- siteCommand- The siteCommand to set.
 
 - 
setInitialSiteCommandpublic void setInitialSiteCommand(java.lang.String initialCommand) Sets the initialSiteCommand attribute. This attribute names a site command that will be executed immediately after connection.- Parameters:
- initialCommand- The initialSiteCommand to set.
 
 - 
setEnableRemoteVerificationpublic void setEnableRemoteVerification(boolean b) Whether to verify that data and control connections are connected to the same remote host.- Parameters:
- b- boolean
- Since:
- Ant 1.8.0
 
 - 
setDataTimeoutpublic void setDataTimeout(int dataTimeout) Sets the timeout on the data connection in milliseconds. Any negative value is discarded and leaves the default A value of 0 means an infinite timeout- Parameters:
- dataTimeout- int
- Since:
- Ant 1.10.7
 
 - 
setWakeUpTransferIntervalpublic void setWakeUpTransferInterval(int wakeUpTransferInterval) Sets the time interval when we should automatically call a command triggering a transfer The parameter is in seconds- Parameters:
- wakeUpTransferInterval- int
- Since:
- Ant 1.10.7
 
 - 
checkAttributesprotected void checkAttributes() throws BuildExceptionChecks to see that all required parameters are set.- Throws:
- BuildException- if the configuration is not valid.
 
 - 
executeRetryableprotected void executeRetryable(RetryHandler h, Retryable r, java.lang.String descr) throws java.io.IOException Executable a retryable object.- Parameters:
- h- the retry handler.
- r- the object that should be retried until it succeeds or the number of retries is reached.
- descr- a description of the command that is being run.
- Throws:
- java.io.IOException- if there is a problem.
 
 - 
transferFilesprotected int transferFiles(org.apache.commons.net.ftp.FTPClient ftp, FileSet fs) throws java.io.IOException, BuildExceptionFor each file in the fileset, do the appropriate action: send, get, delete, or list.- Parameters:
- ftp- the FTPClient instance used to perform FTP actions
- fs- the fileset on which the actions are performed.
- Returns:
- the number of files to be transferred.
- Throws:
- java.io.IOException- if there is a problem reading a file
- BuildException- if there is a problem in the configuration.
 
 - 
transferFilesprotected void transferFiles(org.apache.commons.net.ftp.FTPClient ftp) throws java.io.IOException, BuildExceptionSends all files specified by the configured filesets to the remote server.- Parameters:
- ftp- the FTPClient instance used to perform FTP actions
- Throws:
- java.io.IOException- if there is a problem reading a file
- BuildException- if there is a problem in the configuration.
 
 - 
resolveFileprotected java.lang.String resolveFile(java.lang.String file) Correct a file path to correspond to the remote host requirements. This implementation currently assumes that the remote end can handle Unix-style paths with forward-slash separators. This can be overridden with theseparatortask parameter. No attempt is made to determine what syntax is appropriate for the remote host.- Parameters:
- file- the remote file name to be resolved
- Returns:
- the filename as it will appear on the server.
 
 - 
createParentsprotected void createParents(org.apache.commons.net.ftp.FTPClient ftp, java.lang.String filename) throws java.io.IOException, BuildExceptionCreates all parent directories specified in a complete relative pathname. Attempts to create existing directories will not cause errors.- Parameters:
- ftp- the FTP client instance to use to execute FTP actions on the remote server.
- filename- the name of the file whose parents should be created.
- Throws:
- java.io.IOException- under non documented circumstances
- BuildException- if it is impossible to cd to a remote directory
 
 - 
isUpToDateprotected boolean isUpToDate(org.apache.commons.net.ftp.FTPClient ftp, java.io.File localFile, java.lang.String remoteFile) throws java.io.IOException, BuildExceptionChecks to see if the remote file is current as compared with the local file. Returns true if the target file is up to date.- Parameters:
- ftp- ftpclient
- localFile- local file
- remoteFile- remote file
- Returns:
- true if the target file is up to date
- Throws:
- java.io.IOException- in unknown circumstances
- BuildException- if the date of the remote files cannot be found and the action is GET_FILES
 
 - 
doSiteCommandprotected void doSiteCommand(org.apache.commons.net.ftp.FTPClient ftp, java.lang.String theCMD) throws java.io.IOException, BuildExceptionSends a site command to the ftp server- Parameters:
- ftp- ftp client
- theCMD- command to execute
- Throws:
- java.io.IOException- in unknown circumstances
- BuildException- in unknown circumstances
 
 - 
sendFileprotected void sendFile(org.apache.commons.net.ftp.FTPClient ftp, java.lang.String dir, java.lang.String filename) throws java.io.IOException, BuildExceptionSends a single file to the remote host.filenamemay contain a relative path specification. When this is the case,sendFilewill attempt to create any necessary parent directories before sending the file. The file will then be sent using the entire relative path spec - no attempt is made to change directories. It is anticipated that this may eventually cause problems with some FTP servers, but it simplifies the coding.- Parameters:
- ftp- ftp client
- dir- base directory of the file to be sent (local)
- filename- relative path of the file to be send locally relative to dir remotely relative to the remotedir attribute
- Throws:
- java.io.IOException- in unknown circumstances
- BuildException- in unknown circumstances
 
 - 
delFileprotected void delFile(org.apache.commons.net.ftp.FTPClient ftp, java.lang.String filename) throws java.io.IOException, BuildExceptionDelete a file from the remote host.- Parameters:
- ftp- ftp client
- filename- file to delete
- Throws:
- java.io.IOException- in unknown circumstances
- BuildException- if skipFailedTransfers is set to false and the deletion could not be done
 
 - 
rmDirprotected void rmDir(org.apache.commons.net.ftp.FTPClient ftp, java.lang.String dirname) throws java.io.IOException, BuildExceptionDelete a directory, if empty, from the remote host.- Parameters:
- ftp- ftp client
- dirname- directory to delete
- Throws:
- java.io.IOException- in unknown circumstances
- BuildException- if skipFailedTransfers is set to false and the deletion could not be done
 
 - 
getFileprotected void getFile(org.apache.commons.net.ftp.FTPClient ftp, java.lang.String dir, java.lang.String filename) throws java.io.IOException, BuildExceptionRetrieve a single file from the remote host.filenamemay contain a relative path specification.The file will then be retrieved using the entire relative path spec - no attempt is made to change directories. It is anticipated that this may eventually cause problems with some FTP servers, but it simplifies the coding. - Parameters:
- ftp- the ftp client
- dir- local base directory to which the file should go back
- filename- relative path of the file based upon the ftp remote directory and/or the local base directory (dir)
- Throws:
- java.io.IOException- in unknown circumstances
- BuildException- if skipFailedTransfers is false and the file cannot be retrieved.
 
 - 
listFileprotected void listFile(org.apache.commons.net.ftp.FTPClient ftp, java.io.BufferedWriter bw, java.lang.String filename) throws java.io.IOException, BuildExceptionList information about a single file from the remote host.filenamemay contain a relative path specification.The file listing will then be retrieved using the entire relative path spec - no attempt is made to change directories. It is anticipated that this may eventually cause problems with some FTP servers, but it simplifies the coding. - Parameters:
- ftp- ftp client
- bw- buffered writer
- filename- the directory one wants to list
- Throws:
- java.io.IOException- in unknown circumstances
- BuildException- in unknown circumstances
 
 - 
makeRemoteDirprotected void makeRemoteDir(org.apache.commons.net.ftp.FTPClient ftp, java.lang.String dir) throws java.io.IOException, BuildExceptionCreate the specified directory on the remote host.- Parameters:
- ftp- The FTP client connection
- dir- The directory to create (format must be correct for host type)
- Throws:
- java.io.IOException- in unknown circumstances
- BuildException- if ignoreNoncriticalErrors has not been set to true and a directory could not be created, for instance because it was already existing. Precisely, the codes 521, 550 and 553 will trigger a BuildException
 
 - 
executepublic void execute() throws BuildExceptionRuns the task.- Overrides:
- executein class- Task
- Throws:
- BuildException- if the task fails or is not configured correctly.
 
 - 
logpublic abstract void log(java.lang.String msg, int level)
 
- 
 
-