cvs commit: jakarta-commons/net/src/java/org/apache/commons/net/ftp FTPFileEntryParser.java
scohen 2004/01/05 14:29:21 Modified:net/src/java/org/apache/commons/net/ftp FTPFileEntryParser.java Log: Change documentation to reflect previous FTPClient changes Revision ChangesPath 1.9 +13 -11 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.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- FTPFileEntryParser.java 3 Jan 2004 17:55:22 - 1.8 +++ FTPFileEntryParser.java 5 Jan 2004 22:29:21 - 1.9 @@ -89,19 +89,20 @@ *} * /pre * - * The second example uses the newer codeFTPClient.getFileList()/code - * API to pull the whole list from the codesubfolder/codein one call, - * attempting to automatically detect the parser type. The null parameter - * indicates that autodection should be used. + * The second example uses the revised codeFTPClient.listFiles()/code + * API to pull the whole list from the subfolder codesubfolder/code in + * one call, attempting to automatically detect the parser type. This + * method, without a parserKey parameter, indicates that autodection should + * be used. * * pre *FTPClient f=FTPClient(); *f.connect(server); *f.login(username, password); - *FTPFile[] files = f.getFileList(null, subfolder); + *FTPFile[] files = f.listFiles(subfolder); * /pre * - * The third example uses the newer codeFTPClient.getFileList()/code + * The third example uses the revised codeFTPClient.listFiles()/code * API to pull the whole list from the current working directory in one call, * but specifying by classname the parser to be used. For this particular * parser class, this approach is necessary since there is no way to @@ -111,11 +112,12 @@ *FTPClient f=FTPClient(); *f.connect(server); *f.login(username, password); - *FTPFile[] files = f.getFileList( - * org.apache.commons.net.ftp.parser.EnterpriseUnixFTPFileEntryParser); + *FTPFile[] files = f.listFiles( + * org.apache.commons.net.ftp.parser.EnterpriseUnixFTPFileEntryParser, + * .); * /pre * - * The fourth example uses the newer codeFTPClient.getFileList()/code + * The fourth example uses the revised codeFTPClient.listFiles()/code * API to pull a single file listing in an arbitrary directory in one call, * specifying by KEY the parser to be used, in this case, VMS. * @@ -123,7 +125,7 @@ *FTPClient f=FTPClient(); *f.connect(server); *f.login(username, password); - *FTPFile[] files = f.getFileList(VMS, subfolder/foo.java); + *FTPFile[] files = f.listFiles(VMS, subfolder/foo.java); * /pre * * @author a href=mailto:[EMAIL PROTECTED]Steve Cohen/a - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons/net/src/java/org/apache/commons/net/ftp FTPFileEntryParser.java
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 ChangesPath 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 - 1.4 +++ FTPFileEntryParser.java 30 Dec 2003 04:04:11 - 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 codeparser /code + * is an object (in the package codeorg.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]
cvs commit: jakarta-commons/net/src/java/org/apache/commons/net/ftp FTPFileEntryParser.java FTPFileIterator.java FTPFileList.java FTPFileListParserImpl.java FTPClient.java
scohen 2003/03/02 10:15:24 Modified:net/src/java/org/apache/commons/net/ftp FTPClient.java Added: net/src/java/org/apache/commons/net/ftp FTPFileEntryParser.java FTPFileIterator.java FTPFileList.java FTPFileListParserImpl.java Log: new parsing system formerly in ftp 2 directory, moving to main stem now. This version provides a means of solving the problem of ftp entries that span more than one line. Revision ChangesPath 1.6 +84 -0 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.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- FTPClient.java26 Jan 2003 00:21:43 - 1.5 +++ FTPClient.java2 Mar 2003 18:15:24 - 1.6 @@ -2020,6 +2020,90 @@ return listFiles(__fileListParser); } +/** + * Using a programmer specified code FTPFileEntryParser /code, + * initialize an object containing a raw file information for the + * current working directory. This information is obtained through + * the LIST command. This object is then capable of being iterated to + * return a sequence of FTPFile objects with information filled in by the + * code FTPFileEntryParser /code used. + * The server may or may not expand glob expressions. You should avoid + * using glob expressions because the return format for glob listings + * differs from server to server and will likely cause this method to fail. + * p + * @param parser The code FTPFileEntryParser /code that should be + * used to parse each server file listing. + * @return An iteratable object that holds the raw information and is + * capable of providing parsed FTPFile objects, one for each file containing + * information contained in the given path in the format determined by the + * code parser /code parameter. Null will be returned if a + * data connection cannot be opened. If the current working directory + * contains no files, an empty array will be the return. + * @exception FTPConnectionClosedException + * If the FTP server prematurely closes the connection as a result + * of the client being idle or some other reason causing the server + * to send FTP reply code 421. This exception may be caught either + * as an IOException or independently as itself. + * @exception IOException If an I/O error occurs while either sending a + * command to the server or receiving a reply from the server. + * @see FTPFileList + */ +public FTPFileList createFileList(FTPFileEntryParser parser) +throws IOException +{ +return createFileList(null, parser); +} + +/** + * Using a programmer specified code FTPFileEntryParser /code, + * initialize an object containing a raw file information for a directory + * or information for a single file. This information is obtained through + * the LIST command. This object is then capable of being iterated to + * return a sequence of FTPFile objects with information filled in by the + * code FTPFileEntryParser /code used. + * The server may or may not expand glob expressions. You should avoid + * using glob expressions because the return format for glob listings + * differs from server to server and will likely cause this method to fail. + * p + * @param parser The code FTPFileEntryParser /code that should be + * used to parse each server file listing. + * @param pathname The file or directory to list. + * @return An iteratable object that holds the raw information and is + * capable of providing parsed FTPFile objects, one for each file containing + * information contained in the given path in the format determined by the + * code parser /code parameter. Null will be returned if a + * data connection cannot be opened. If the supplied path contains + * no files, an empty array will be the return. + * @exception FTPConnectionClosedException + * If the FTP server prematurely closes the connection as a result + * of the client being idle or some other reason causing the server + * to send FTP reply code 421. This exception may be caught either + * as an IOException or independently as itself. + * @exception IOException If an I/O error occurs while either sending a + * command to the server or receiving a reply from the server. + * @see FTPFileList + */ +public FTPFileList createFileList(String
cvs commit: jakarta-commons/net/src/java/org/apache/commons/net/ftp FTPFileEntryParser.java FTPFileIterator.java FTPFileList.java
scohen 2003/03/02 19:42:06 Modified:net/src/java/org/apache/commons/net/ftp FTPFileEntryParser.java FTPFileIterator.java FTPFileList.java Log: remove stale @see references from javadocs Revision ChangesPath 1.3 +2 -2 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.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- FTPFileEntryParser.java 2 Mar 2003 19:36:43 - 1.2 +++ FTPFileEntryParser.java 3 Mar 2003 03:42:05 - 1.3 @@ -67,7 +67,7 @@ * @author a href=mailto:[EMAIL PROTECTED]Steve Cohen/a * @version $Id$ * @see org.apache.commons.net.ftp.FTPFile - * @see FTPClient2#listFiles + * @see org.apache.commons.net.ftp.FTPClient#createFileList */ public interface FTPFileEntryParser { 1.3 +2 -2 jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileIterator.java Index: FTPFileIterator.java === RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- FTPFileIterator.java 2 Mar 2003 19:36:43 - 1.2 +++ FTPFileIterator.java 3 Mar 2003 03:42:05 - 1.3 @@ -65,7 +65,7 @@ * * @author a href=mailto:[EMAIL PROTECTED]Steve Cohen/a * @version $Id$ - * @see org.apache.commons.net.ftp.ftp2.FTPFileList + * @see org.apache.commons.net.ftp.FTPFileList */ public class FTPFileIterator { 1.3 +2 -3 jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileList.java Index: FTPFileList.java === RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileList.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- FTPFileList.java 2 Mar 2003 19:36:43 - 1.2 +++ FTPFileList.java 3 Mar 2003 03:42:05 - 1.3 @@ -77,8 +77,7 @@ * * @author a href=mailto:[EMAIL PROTECTED]Steve Cohen/a * @version $Id$ - * @see FTPClient2#listFiles - * @see FTPClient2#createFileList + * @see org.apache.commons.net.ftp.FTPClient#createFileList */ public class FTPFileList { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]