ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 5053] New: - the optional FTP task does not perform it's action without a remote dir specified
Date Fri, 23 Nov 2001 16:42:14 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5053>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5053

the optional FTP task does not perform it's action without a remote dir specified

           Summary: the optional FTP task does not perform it's action
                    without a remote dir specified
           Product: Ant
           Version: 1.4.1
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Optional Tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: remco.slotboom@ctp.com


Although it is not a required attribute, the optional FTP task does not do 
anything useful (only logs in and out) if the 'remotedir' attribute is not 
specified. Setting the remotedir to "." is a workaround to this problem. 

I examined the source and found the problem in an if-then-else that is a bit 
too liberal. The following snippet fixes the problem:

  public void execute()
        throws BuildException
    {
[snip]

           if( action == MK_DIR ) {

                makeRemoteDir( ftp, remotedir );

            } else {
                if (remotedir != null)
                {
                    log("changing the remote directory", Project.MSG_VERBOSE);
                    ftp.changeWorkingDirectory(remotedir);
                    if (!FTPReply.isPositiveCompletion(ftp.getReplyCode()))
                    {
                        throw new BuildException(
                                                 "could not change              
remote directory: " + ftp.getReplyString());
                    }
                }
                log(ACTION_STRS[action] + " files");
                transferFiles(ftp);
            }

        }
        catch(IOException ex)
        {
[snip]

(Otherwise, FTP with ANT works great by the way).

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message