From d98034a54c5078adecb4ac4096f386f3d8e8bf92 Mon Sep 17 00:00:00 2001 From: Antoine Levy-Lambert Date: Tue, 5 Aug 2003 16:44:43 +0000 Subject: [PATCH] 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 --- .../apache/tools/ant/taskdefs/optional/net/FTP.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java b/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java index 8569c016d..8dd02761b 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java @@ -215,7 +215,19 @@ public class FTP try { 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 + scandir(".", "", true); ftp.changeWorkingDirectory(cwd); } catch (IOException e) {