Author: scohen
Date: Mon Feb 14 19:42:11 2005
New Revision: 153885
URL: http://svn.apache.org/viewcvs?view=rev&rev=153885
Log:
Deprecate FTPClient.listFiles(String, String) to avoid confusion over new
FTPClientConfig methods
Modified:
jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/FTPClient.java
jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/ListingFunctionalTest.java
Modified:
jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/FTPClient.java
URL:
http://svn.apache.org/viewcvs/jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/FTPClient.java?view=diff&r1=153884&r2=153885
==============================================================================
---
jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/FTPClient.java
(original)
+++
jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/FTPClient.java
Mon Feb 14 19:42:11 2005
@@ -2077,6 +2077,9 @@
* @see org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory
* @see org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory
* @see org.apache.commons.net.ftp.FTPFileEntryParser
+ * @deprecated use [EMAIL PROTECTED] #listFiles() listFiles()} or
+ * [EMAIL PROTECTED] #listFiles(String) listFiles(String)} instead and
specify the
+ * parser Key in an [EMAIL PROTECTED] #FTPClientConfig FTPClientConfig}
object instead.
*/
public FTPFile[] listFiles(String parserKey, String pathname)
throws IOException
@@ -2132,7 +2135,10 @@
throws IOException
{
String key = null;
- return listFiles(key, pathname);
+ FTPListParseEngine engine =
+ initiateListParsing(key, pathname);
+ return engine.getFiles();
+
}
/**
* Using the default system autodetect mechanism, obtain a
Modified:
jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/ListingFunctionalTest.java
URL:
http://svn.apache.org/viewcvs/jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/ListingFunctionalTest.java?view=diff&r1=153884&r2=153885
==============================================================================
---
jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/ListingFunctionalTest.java
(original)
+++
jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/ListingFunctionalTest.java
Mon Feb 14 19:42:11 2005
@@ -27,7 +27,7 @@
/**
* A functional test suite for checking that site listings work.
* @author <a href="mailto:[EMAIL PROTECTED]">Jeffrey D. Brekke</a>
- * @version $Id: ListingFunctionalTest.java,v 1.6 2004/04/21 23:30:33 scohen
Exp $
+ * @version $Id$
*/
public class ListingFunctionalTest extends TestCase
{
@@ -248,7 +248,9 @@
public void testListFiles()
throws IOException
{
- List files = Arrays.asList(client.listFiles(validParserKey,
validPath));
+ FTPClientConfig config = new FTPClientConfig(validParserKey);
+ client.configure(config);
+ List files = Arrays.asList(client.listFiles(validPath));
assertTrue(files.toString(),
findByName(files, validFilename));
@@ -271,7 +273,10 @@
public void testListFilesWithIncorrectParser()
throws IOException
{
- FTPFile[] files = client.listFiles(invalidParserKey, validPath);
+ FTPClientConfig config = new FTPClientConfig(invalidParserKey);
+ client.configure(config);
+
+ FTPFile[] files = client.listFiles(validPath);
assertEquals(0, files.length);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]