/[Apache-SVN]/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
ViewVC logotype

Diff of /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 526548, Sun Apr 8 12:43:36 2007 UTC revision 574313, Mon Sep 10 17:43:31 2007 UTC
# Line 371  public class FTP Line 371  public class FTP
371                  }                  }
372                  for (int i = 0; i < newfiles.length; i++) {                  for (int i = 0; i < newfiles.length; i++) {
373                      FTPFile file = newfiles[i];                      FTPFile file = newfiles[i];
374                      if (!file.getName().equals(".")                      if (file != null
375                                && !file.getName().equals(".")
376                           && !file.getName().equals("..")) {                           && !file.getName().equals("..")) {
377                          if (isFunctioningAsDirectory(ftp, dir, file)) {                          if (isFunctioningAsDirectory(ftp, dir, file)) {
378                              String name = vpath + file.getName();                              String name = vpath + file.getName();
# Line 571  public class FTP Line 572  public class FTP
572              boolean candidateFound = false;              boolean candidateFound = false;
573              String target = null;              String target = null;
574              for (int icounter = 0; icounter < array.length; icounter++) {              for (int icounter = 0; icounter < array.length; icounter++) {
575                  if (array[icounter].isDirectory()) {                  if (array[icounter] != null && array[icounter].isDirectory()) {
576                      if (!array[icounter].getName().equals(".")                      if (!array[icounter].getName().equals(".")
577                          && !array[icounter].getName().equals("..")) {                          && !array[icounter].getName().equals("..")) {
578                          candidateFound = true;                          candidateFound = true;
# Line 580  public class FTP Line 581  public class FTP
581                              + target + " where a directory called " + array[icounter].getName()                              + target + " where a directory called " + array[icounter].getName()
582                              + " exists", Project.MSG_DEBUG);                              + " exists", Project.MSG_DEBUG);
583                          for (int pcounter = 0; pcounter < array.length; pcounter++) {                          for (int pcounter = 0; pcounter < array.length; pcounter++) {
584                              if (array[pcounter].getName().equals(target) && pcounter != icounter) {                              if (array[pcounter] != null && pcounter != icounter && target.equals(array[pcounter].getName()) ) {
585                                  candidateFound = false;                                  candidateFound = false;
586                              }                              }
587                          }                          }
# Line 719  public class FTP Line 720  public class FTP
720                      return null;                      return null;
721                  }                  }
722                  for (int icounter = 0; icounter < theFiles.length; icounter++) {                  for (int icounter = 0; icounter < theFiles.length; icounter++) {
723                      if (theFiles[icounter].getName().equalsIgnoreCase(soughtPathElement)) {                      if (theFiles[icounter] != null && theFiles[icounter].getName().equalsIgnoreCase(soughtPathElement)) {
724                          return theFiles[icounter].getName();                          return theFiles[icounter].getName();
725                      }                      }
726                  }                  }
# Line 841  public class FTP Line 842  public class FTP
842                      return null;                      return null;
843                  }                  }
844                  for (int fcount = 0; fcount < theFiles.length; fcount++) {                  for (int fcount = 0; fcount < theFiles.length; fcount++) {
845                        if (theFiles[fcount] != null) {
846                       if (theFiles[fcount].getName().equals(lastpathelement)) {                       if (theFiles[fcount].getName().equals(lastpathelement)) {
847                           return theFiles[fcount];                           return theFiles[fcount];
848                       } else if (!isCaseSensitive()                       } else if (!isCaseSensitive()
849                           && theFiles[fcount].getName().equalsIgnoreCase(lastpathelement)) {                                  && theFiles[fcount].getName().equalsIgnoreCase(
850                                            lastpathelement)) {
851                           return theFiles[fcount];                           return theFiles[fcount];
852                       }                       }
853                  }                  }
854                    }
855                  return null;                  return null;
856              }              }
857              /**              /**
# Line 1825  public class FTP Line 1829  public class FTP
1829              String fileName = localFile.getName();              String fileName = localFile.getName();
1830              boolean found = false;              boolean found = false;
1831              try {              try {
1832                  if (counter == 1) {                  if (theFiles == null) {
1833                      theFiles = ftp.listFiles();                      theFiles = ftp.listFiles();
1834                  }                  }
1835                  for (int counter2 = 0; counter2 < theFiles.length; counter2++) {                  for (int counter2 = 0; counter2 < theFiles.length; counter2++) {
1836                      if (theFiles[counter2].getName().equals(fileName)) {                      if (theFiles[counter2] != null && theFiles[counter2].getName().equals(fileName)) {
1837                          found = true;                          found = true;
1838                          break;                          break;
1839                      }                      }

Legend:
Removed from v.526548  
changed lines
  Added in v.574313

apache@apache.org
ViewVC Help
Powered by ViewVC 1.1.2