servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r469285 - /incubator/servicemix/trunk/servicemix-ftp/src/main/java/org/apache/servicemix/ftp/FtpPollingEndpoint.java
Date Mon, 30 Oct 2006 21:55:31 GMT
Author: gnodet
Date: Mon Oct 30 13:55:30 2006
New Revision: 469285

URL: http://svn.apache.org/viewvc?view=rev&rev=469285
Log:
Fix infinite loop problem on ftp servers reporting "." and ".." dirs.
Thanks to Allan Brighton.

Modified:
    incubator/servicemix/trunk/servicemix-ftp/src/main/java/org/apache/servicemix/ftp/FtpPollingEndpoint.java

Modified: incubator/servicemix/trunk/servicemix-ftp/src/main/java/org/apache/servicemix/ftp/FtpPollingEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-ftp/src/main/java/org/apache/servicemix/ftp/FtpPollingEndpoint.java?view=diff&rev=469285&r1=469284&r2=469285
==============================================================================
--- incubator/servicemix/trunk/servicemix-ftp/src/main/java/org/apache/servicemix/ftp/FtpPollingEndpoint.java
(original)
+++ incubator/servicemix/trunk/servicemix-ftp/src/main/java/org/apache/servicemix/ftp/FtpPollingEndpoint.java
Mon Oct 30 13:55:30 2006
@@ -211,7 +211,12 @@
         for (int i = 0; i < files.length; i++) {
             String file = fileOrDirectory + "/" + files[i].getName();
             if (!files[i].isDirectory()) {
-                if (getFilter() == null || getFilter().accept(new File(file))) {
+                File f = new File(file);
+                String name = f.getName();
+                if (name.equals(".") || name.equals("..")) {
+                    continue; // ignore "." and ".."
+                }
+                if (getFilter() == null || getFilter().accept(f)) {
                     pollFile(file); // process the file
                 }
             } else if (processDir) {



Mime
View raw message