Author: bodewig
Date: Mon May 17 09:23:03 2010
New Revision: 945041
URL: http://svn.apache.org/viewvc?rev=945041&view=rev
Log:
merge fix for PR 49296
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTPTaskMirrorImpl.java
(contents, props changed)
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTPTaskMirrorImpl.java
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTPTaskMirrorImpl.java?rev=945041&r1=945040&r2=945041&view=diff
==============================================================================
---
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTPTaskMirrorImpl.java
(original)
+++
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTPTaskMirrorImpl.java
Mon May 17 09:23:03 2010
@@ -736,7 +736,7 @@ public class FTPTaskMirrorImpl implement
} else if (!result) {
return;
}
- this.curpwd = this.curpwd + task.getSeparator()
+ this.curpwd = getCurpwdPlusFileSep()
+ currentPathElement;
} catch (IOException ioe) {
throw new BuildException("could not change working dir
to "
@@ -797,7 +797,7 @@ public class FTPTaskMirrorImpl implement
* @return absolute path as string
*/
public String getAbsolutePath() {
- return curpwd + task.getSeparator() + ftpFile.getName();
+ return getCurpwdPlusFileSep() + ftpFile.getName();
}
/**
* find out the relative path assuming that the path used to
construct
@@ -943,6 +943,17 @@ public class FTPTaskMirrorImpl implement
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() {
+ String sep = task.getSeparator();
+ return curpwd.endsWith(sep) ? curpwd : curpwd + sep;
+ }
+ /**
* find out if a symbolic link is encountered in the relative path
of this file
* from rootPath.
* @return <code>true</code> if a symbolic link is encountered in
the relative path.
Propchange:
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTPTaskMirrorImpl.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon May 17 09:23:03 2010
@@ -0,0 +1 @@
+/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java:945039