Browse Source

Make the FTP.FTPDirectoryScanner class also register the root of a fileset

when the root matches include exclude patterns.
This is the behavior of the DirectoryScanner for normal filesets.
This change should only possibly impact the RMDIR modus of the ftp task
when the root directory is included.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275026 13f79535-47bb-0310-9956-ffa450edef68
master
Antoine Levy-Lambert 22 years ago
parent
commit
d98034a54c
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java

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

@@ -215,7 +215,19 @@ public class FTP


try { try {
String cwd = ftp.printWorkingDirectory(); String cwd = ftp.printWorkingDirectory();
// register also the root directory of the fileset if it matches
// include and exclude patterns
if (isIncluded("")) {
if (!isExcluded("")) {
dirsIncluded.addElement("");
} else {
dirsExcluded.addElement("");
}
} else {
dirsNotIncluded.addElement("");
}
// always start from the current ftp working dir // always start from the current ftp working dir

scandir(".", "", true); scandir(".", "", true);
ftp.changeWorkingDirectory(cwd); ftp.changeWorkingDirectory(cwd);
} catch (IOException e) { } catch (IOException e) {


Loading…
Cancel
Save