Browse Source

Merge from ANT_16_BRANCH

Fix problem with non absolute remote dirs
PR: 23833


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275510 13f79535-47bb-0310-9956-ffa450edef68
master
Antoine Levy-Lambert 21 years ago
parent
commit
d3f03ad754
3 changed files with 10 additions and 2 deletions
  1. +4
    -1
      src/etc/testcases/taskdefs/optional/net/ftp.xml
  2. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
  3. +5
    -0
      src/testcases/org/apache/tools/ant/taskdefs/optional/net/FTPTest.java

+ 4
- 1
src/etc/testcases/taskdefs/optional/net/ftp.xml View File

@@ -4,9 +4,9 @@
<property name="ftp.host" value="localhost"/>
<property name="ftp.port" value="21" />
<property name="ftp.password" value="sunshine" />
<property name="ftp.filesep" value="/"/>
<property name="tmp.dir" location="tmp"/>
<property name="tmp.get.dir" location="tmp.get"/>
<property name="ftp.filesep" value="/"/>
<fileset dir="${tmp.get.dir}" id="fileset-destination-with-selector">
<include name="alpha/**"/>
<filename name="**/alpha.xml" />
@@ -34,6 +34,7 @@
server="${ftp.host}"
userid="${ftp.user}"
password="${ftp.password}"
separator="${ftp.filesep}"
remotedir="${tmp.dir}">
<fileset refid="fileset-destination-with-selector"/>
</ftp>
@@ -57,6 +58,7 @@
server="${ftp.host}"
userid="${ftp.user}"
password="${ftp.password}"
separator="${ftp.filesep}"
remotedir="${tmp.dir}"
>
<fileset refid="fileset-destination-followsymlinks"/>
@@ -67,6 +69,7 @@
server="${ftp.host}"
userid="${ftp.user}"
password="${ftp.password}"
separator="${ftp.filesep}"
remotedir="${tmp.dir}"
>
<fileset refid="fileset-destination-nofollowsymlinks"/>


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java View File

@@ -273,7 +273,7 @@ public class FTP
// construct it
if (newroots.containsKey("")) {
// we are going to scan everything anyway
scandir(remotedir, "", true);
scandir(rootPath, "", true);
} else {
// only scan directories that can include matched files or
// directories


+ 5
- 0
src/testcases/org/apache/tools/ant/taskdefs/optional/net/FTPTest.java View File

@@ -113,6 +113,11 @@ public class FTPTest extends BuildFileTest{
}

public void tearDown() {
try {
ftp.disconnect();
} catch (IOException ioe) {
// do nothing
}
getProject().executeTarget("cleanup");
}
private boolean changeRemoteDir(String remoteDir) {


Loading…
Cancel
Save