Browse Source

Make <ftp>'s directory scanner behave the same way as the one for

normal filesets when it comes to pattern matching.  The current
version did not look at the directory part at all.

PR: 4411


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272430 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 23 years ago
parent
commit
b7e18b46c4
1 changed files with 11 additions and 9 deletions
  1. +11
    -9
      src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java

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

@@ -206,29 +206,31 @@ public class FTP
if (!file.getName().equals(".") if (!file.getName().equals(".")
&& !file.getName().equals("..")) { && !file.getName().equals("..")) {
if (file.isDirectory()) { if (file.isDirectory()) {
String name = file.getName();
String name = vpath + file.getName();
if (isIncluded(name)) { if (isIncluded(name)) {
if (!isExcluded(name)) { if (!isExcluded(name)) {
dirsIncluded.addElement(name); dirsIncluded.addElement(name);
if (fast) { if (fast) {
scandir(name,
vpath + name + File.separator,
fast);
scandir(file.getName(),
name + File.separator, fast);
} }
} else { } else {
dirsExcluded.addElement(name); dirsExcluded.addElement(name);
if (fast && couldHoldIncluded(name)) {
scandir(file.getName(),
name + File.separator, fast);
}
} }
} else { } else {
dirsNotIncluded.addElement(name); dirsNotIncluded.addElement(name);
if (fast && couldHoldIncluded(name)) { if (fast && couldHoldIncluded(name)) {
scandir(name,
vpath + name + File.separator,
fast);
scandir(file.getName(),
name + File.separator, fast);
} }
} }
if (!fast) { if (!fast) {
scandir(name, vpath + name + File.separator,
fast);
scandir(file.getName(),
name + File.separator, fast);
} }
} else { } else {
if (file.isFile()) { if (file.isFile()) {


Loading…
Cancel
Save