You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sc...@apache.org on 2004/01/17 19:36:17 UTC

cvs commit: jakarta-commons/net/src/java/org/apache/commons/net/ftp FTPClient.java FTPListParseEngine.java

scohen      2004/01/17 10:36:17

  Modified:    net/src/java/org/apache/commons/net/ftp FTPClient.java
                        FTPListParseEngine.java
  Log:
  improve documentation
  
  Revision  Changes    Path
  1.30      +42 -1     jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPClient.java
  
  Index: FTPClient.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPClient.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- FTPClient.java	17 Jan 2004 17:20:25 -0000	1.29
  +++ FTPClient.java	17 Jan 2004 18:36:17 -0000	1.30
  @@ -201,8 +201,49 @@
    * specification that it cannot be interpreted in a useful manner despite
    * attempts to be as lenient as possible.
    * <p>
  + * Listing API Examples
  + * Both paged and unpaged examples of directory listings are available, 
  + * as follows:
    * <p>
  - * @author Daniel F. Savarese
  + * Unpaged (whole list) access, using a parser accessible by auto-detect:
  + * <pre>
  + *    FTPClient f=FTPClient();
  + *    f.connect(server);
  + *    f.login(username, password);
  + *    FTPFile[] files = listFiles(directory);
  + * </pre>
  + * <p>
  + * Paged access, using a parser not accessible by auto-detect.  The class
  + * defined in the first parameter of initateListParsing should be derived
  + * from org.apache.commons.net.FTPFileEntryParser:
  + * <pre>
  + *    FTPClient f=FTPClient();
  + *    f.connect(server);
  + *    f.login(username, password);
  + *    FTPListParseEngine engine = 
  + *       f.initiateListParsing("com.whatever.YourOwnParser", directory);
  + * 
  + *    while (engine.hasNext()) {
  + *       FTPFile[] files = engine.getNext(25);  // "page size" you want
  + *       //do whatever you want with these files, display them, etc.
  + *       //expensive FTPFile objects not created until needed.
  + *    }
  + * </pre>
  + * <p>
  + * Paged access, using a parser accessible by auto-detect:
  + * <pre>
  + *    FTPClient f=FTPClient();
  + *    f.connect(server);
  + *    f.login(username, password);
  + *    FTPListParseEngine engine = f.initiateListParsing(directory);
  + * 
  + *    while (engine.hasNext()) {
  + *       FTPFile[] files = engine.getNext(25);  // "page size" you want
  + *       //do whatever you want with these files, display them, etc.
  + *       //expensive FTPFile objects not created until needed.
  + *    }
  + * </pre>
  + * <p> * @author Daniel F. Savarese
    * @see FTP
    * @see FTPConnectionClosedException
    * @see FTPFileEntryParser
  
  
  
  1.2       +2 -1      jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPListParseEngine.java
  
  Index: FTPListParseEngine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPListParseEngine.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FTPListParseEngine.java	17 Jan 2004 17:20:26 -0000	1.1
  +++ FTPListParseEngine.java	17 Jan 2004 18:36:17 -0000	1.2
  @@ -96,7 +96,7 @@
    *    FTPClient f=FTPClient();
    *    f.connect(server);
    *    f.login(username, password);
  - *    FTPListParseEngine engine = f.initiateListParsing(directory, parser);
  + *    FTPListParseEngine engine = f.initiateListParsing(directory);
    * 
    *    while (engine.hasNext()) {
    *       FTPFile[] files = engine.getNext(25);  // "page size" you want
  @@ -104,6 +104,7 @@
    *       //expensive FTPFile objects not created until needed.
    *    }
    * </pre>
  + * @version
    */
   public class FTPListParseEngine {
   	private List entries = new LinkedList();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org