scohen 2003/12/29 20:04:11 Modified: net/src/java/org/apache/commons/net/ftp FTPFileEntryParser.java Log: Add central documentation on parser usage, linked from all the parser implemenation javadocs. Revision Changes Path 1.5 +22 -3 jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileEntryParser.java Index: FTPFileEntryParser.java =================================================================== RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileEntryParser.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- FTPFileEntryParser.java 6 Mar 2003 12:38:42 -0000 1.4 +++ FTPFileEntryParser.java 30 Dec 2003 04:04:11 -0000 1.5 @@ -59,12 +59,31 @@ /** * FTPFileEntryParser defines the interface for parsing a single FTP file - * listing and converting that information into an + * listing and converting that information into an * <a href="org.apache.commons.net.ftp.FTPFile.html"> FTPFile </a> instance. * Sometimes you will want to parse unusual listing formats, in which * case you would create your own implementation of FTPFileEntryParser and * if necessary, subclass FTPFile. - * + * <p> + * Here is an example showing how to use one of the classes that + * implement this interface. In the following example <code>parser </code> + * is an object (in the package <code>org.apache.commons.net.ftp.parser</code>) + * implementing this inteface. + * + * <pre> + * FTPClient f=FTPClient(); + * f.connect(server); + * f.login(username, password); + * FTPFileList list = createFTPFileList(directory, parser); + * FTPFileIterator iter = list.iterator(); + * + * while (iter.hasNext()) { + * FTPFile[] files = iter.getNext(25); // "page size" you want + * //do whatever you want with these files, display them, etc. + * //expensive FTPFile objects not created until needed. + * } + * </pre> + * * @author <a href="mailto:[EMAIL PROTECTED]">Steve Cohen</a> * @version $Id$ * @see org.apache.commons.net.ftp.FTPFile
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]