You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2010/07/12 18:43:01 UTC

svn commit: r963340 - /commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClient.java

Author: sebb
Date: Mon Jul 12 16:43:00 2010
New Revision: 963340

URL: http://svn.apache.org/viewvc?rev=963340&view=rev
Log:
NET-244 Add support for FTPFileFilter filters to FTPClient

Modified:
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClient.java

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClient.java?rev=963340&r1=963339&r2=963340&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClient.java (original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClient.java Mon Jul 12 16:43:00 2010
@@ -2271,6 +2271,22 @@ implements Configurable
     }
 
     /**
+     * Version of {@link #listFiles(String)} which allows a filter to be provided.
+     * For example: <code>listFiles("site", FTPFileFilters.DIRECTORY);</code>
+     * @param pathname the initial path, may be null
+     * @param filter the filter, non-null
+     * @return the list of FTPFile entries.
+     * @throws IOException
+     */
+    public FTPFile[] listFiles(String pathname, FTPFileFilter filter)
+    throws IOException
+    {
+        FTPListParseEngine engine = initiateListParsing((String) null, pathname);
+        return engine.getFiles(filter);
+
+    }
+
+    /**
      * Using the default autodetect mechanism, initialize an FTPListParseEngine
      * object containing a raw file information for the current working
      * directory on the server