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