ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 2285] New: - FTP optional Task...
Date Fri, 22 Jun 2001 14:49:28 GMT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2285

*** shadow/2285	Fri Jun 22 07:49:28 2001
--- shadow/2285.tmp.19689	Fri Jun 22 07:49:28 2001
***************
*** 0 ****
--- 1,87 ----
+ +============================================================================+
+ | FTP optional Task...                                                       |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 2285                        Product: Ant                     |
+ |       Status: NEW                         Version: 1.3                     |
+ |   Resolution:                            Platform: PC                      |
+ |     Severity: Critical                 OS/Version: Other                   |
+ |     Priority: Other                     Component: Optional Tasks          |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: ant-dev@jakarta.apache.org                                   |
+ |  Reported By: Jean-Francois.Morneau@ift.ulaval.ca                          |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ The optinal task does not go recursively in the specified directory accroding 
+ the fileset!
+ 
+ I've fixed the bug:
+ Change the old function to this one and it's fixed!
+ 
+ protected void scandir(String dir, String vpath, boolean fast) {
+             try {
+                 if (!ftp.changeWorkingDirectory(dir)) {
+                     System.out.println("ERROR: " + dir);
+                     return;
+                 }
+                 System.out.println("CHDir:" + ftp.printWorkingDirectory());
+                 FTPFile[] newfiles = ftp.listFiles();
+ 
+                 if (newfiles == null) {
+                     ftp.changeToParentDirectory();
+                     return;
+                 }
+ 
+                 for (int i = 0; i < newfiles.length; i++) {
+                     FTPFile file = newfiles[i];
+                     if(file.getName().equals(".") || file.getName().equals
+ ("..")){
+                     }else{
+                         if (file.isDirectory()) {
+                             String name = file.getName();
+                             if (isIncluded(name)) {
+                                 if (!isExcluded(name)) {
+                                     dirsIncluded.addElement(name);
+                                     if (fast) {
+                                         scandir(name, vpath + name + 
+ File.separator, fast);
+                                     }
+                                 } else {
+                                     dirsExcluded.addElement(name);
+                                 }
+                             } else {
+                                 dirsNotIncluded.addElement(name);
+                                 if (fast && couldHoldIncluded(name)) {
+                                     scandir(name, vpath + name + 
+ File.separator, fast);
+                                 }
+                             }
+                             if (!fast) {
+                                 scandir(name, vpath + name + File.separator, 
+ fast);
+                             }
+                         } else {
+                             if (file.isFile()) {
+                                 String name = vpath + file.getName();
+                                 if (isIncluded(name)) {
+                                     if (!isExcluded(name)) {
+                                         filesIncluded.addElement(name);
+                                     } else {
+                                         filesExcluded.addElement(name);
+                                     }
+                                 } else {
+                                     filesNotIncluded.addElement(name);
+                                 }
+                             }
+                         }
+                     }
+                 }
+                 ftp.changeToParentDirectory();
+             } catch (IOException e) {
+                 throw new BuildException("Error while communicating with FTP 
+ server: ", e);
+             }
+         }
+     }
\ No newline at end of file

Mime
View raw message