commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r963340 - /commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClient.java
Date Mon, 12 Jul 2010 16:43:01 GMT
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



Mime
View raw message