Return-Path: Delivered-To: apmail-ant-notifications-archive@minotaur.apache.org Received: (qmail 72644 invoked from network); 17 May 2010 09:17:50 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 May 2010 09:17:50 -0000 Received: (qmail 81998 invoked by uid 500); 17 May 2010 09:17:50 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 81919 invoked by uid 500); 17 May 2010 09:17:49 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 81912 invoked by uid 99); 17 May 2010 09:17:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 May 2010 09:17:49 +0000 X-ASF-Spam-Status: No, hits=-1531.8 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 May 2010 09:17:48 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0266B23889BF; Mon, 17 May 2010 09:17:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r945039 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java Date: Mon, 17 May 2010 09:17:27 -0000 To: notifications@ant.apache.org From: bodewig@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100517091728.0266B23889BF@eris.apache.org> Author: bodewig Date: Mon May 17 09:17:19 2010 New Revision: 945039 URL: http://svn.apache.org/viewvc?rev=945039&view=rev Log: ftp download fails for certain setups. PR 49296. Based on patch by Kristof Neirynck Modified: ant/core/trunk/WHATSNEW ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java Modified: ant/core/trunk/WHATSNEW URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=945039&r1=945038&r2=945039&view=diff ============================================================================== --- ant/core/trunk/WHATSNEW (original) +++ ant/core/trunk/WHATSNEW Mon May 17 09:17:19 2010 @@ -30,6 +30,10 @@ Fixed bugs: name didn't occur inside more than one directory. Bugzilla Report 36748. + * could fail to download files from remote subdirectories under + certain circumstances. + Bugzilla Report 49296. + Other changes: -------------- Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java?rev=945039&r1=945038&r2=945039&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java Mon May 17 09:17:19 2010 @@ -834,7 +834,7 @@ public class FTP extends Task implements } else if (!result) { return; } - this.curpwd = this.curpwd + remoteFileSep + this.curpwd = getCurpwdPlusFileSep() + currentPathElement; } catch (IOException ioe) { throw new BuildException("could not change working dir to " @@ -895,7 +895,7 @@ public class FTP extends Task implements * @return absolute path as string */ public String getAbsolutePath() { - return curpwd + remoteFileSep + ftpFile.getName(); + return getCurpwdPlusFileSep() + ftpFile.getName(); } /** * find out the relative path assuming that the path used to construct @@ -1037,6 +1037,17 @@ public class FTP extends Task implements return curpwd; } /** + * returns the path of the directory containing the AntFTPFile. + * of the full path of the file itself in case of AntFTPRootFile + * and appends the remote file separator if necessary. + * @return parent directory of the AntFTPFile + * @since Ant 1.8.2 + */ + public String getCurpwdPlusFileSep() { + return curpwd.endsWith(remoteFileSep) ? curpwd + : curpwd + remoteFileSep; + } + /** * find out if a symbolic link is encountered in the relative path of this file * from rootPath. * @return true if a symbolic link is encountered in the relative path.