Author: sebb
Date: Fri Aug 15 11:16:59 2008
New Revision: 686304
URL: http://svn.apache.org/viewvc?rev=686304&view=rev
Log:
NET-230 - ParserInitializationException when connecting to a Unix FTP server:
comparison string must be upper case. Also added check for AS/4000 == OS/400
Modified:
commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/FTPClientConfig.java
commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java
commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java
commons/proper/net/trunk/xdocs/changes.xml
Modified:
commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/FTPClientConfig.java
URL:
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/FTPClientConfig.java?rev=686304&r1=686303&r2=686304&view=diff
==============================================================================
---
commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/FTPClientConfig.java
(original)
+++
commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/FTPClientConfig.java
Fri Aug 15 11:16:59 2008
@@ -171,6 +171,12 @@
*/
public static final String SYST_OS400 = "OS/400";
+
+ /**
+ * Alternate SYST value for an AS/400 system.
+ */
+ public static final String SYST_AS400 = "AS/400";
+
/**
* Identifier by which an MVS-based ftp server is known throughout
* the commons-net ftp system.
@@ -185,7 +191,7 @@
*
* @since 1.5
*/
- public static final String SYST_L8 = "Type: L8";
+ public static final String SYST_L8 = "TYPE: L8";
/**
* Identifier by which an Netware-based ftp server is known throughout
Modified:
commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java
URL:
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java?rev=686304&r1=686303&r2=686304&view=diff
==============================================================================
---
commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java
(original)
+++
commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java
Fri Aug 15 11:16:59 2008
@@ -28,7 +28,7 @@
* org.apache.commons.net.ftp.FTPClient.listFiles()
* if no other implementation has been specified.
*
- * @see org.apache.commons.net.ftp.FTPClient#listFiles
+ * @see org.apache.commons.net.ftp.FTPClient#listFiles()
* @see org.apache.commons.net.ftp.FTPClient#setParserFactory
*/
public class DefaultFTPFileEntryParserFactory
@@ -109,7 +109,8 @@
{
parser = createOS2FTPEntryParser();
}
- else if (ukey.indexOf(FTPClientConfig.SYST_OS400) >= 0)
+ else if ((ukey.indexOf(FTPClientConfig.SYST_OS400) >= 0)
+ || (ukey.indexOf(FTPClientConfig.SYST_AS400) >= 0))
{
parser = createOS400FTPEntryParser();
}
Modified:
commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java
URL:
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java?rev=686304&r1=686303&r2=686304&view=diff
==============================================================================
---
commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java
(original)
+++
commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java
Fri Aug 15 11:16:59 2008
@@ -62,6 +62,15 @@
parser = factory.createFileEntryParser("OS/400");
assertTrue(parser instanceof CompositeFileEntryParser);
+ parser = factory.createFileEntryParser("AS/400");
+ assertTrue(parser instanceof CompositeFileEntryParser);
+
+ // Added test to make sure it handles the Unix systems that were
+ // compiled with OS as "UNKNOWN". This test validates that the
+ // check is case-insensitive.
+ parser = factory.createFileEntryParser("UNKNOWN Type: L8");
+
+
try {
parser = factory.createFileEntryParser("OS2FTPFileEntryParser");
fail("Exception should have been thrown. \"OS2FTPFileEntryParser\"
is not a recognized key");
Modified: commons/proper/net/trunk/xdocs/changes.xml
URL:
http://svn.apache.org/viewvc/commons/proper/net/trunk/xdocs/changes.xml?rev=686304&r1=686303&r2=686304&view=diff
==============================================================================
--- commons/proper/net/trunk/xdocs/changes.xml (original)
+++ commons/proper/net/trunk/xdocs/changes.xml Fri Aug 15 11:16:59 2008
@@ -98,6 +98,10 @@
<action dev="sebb" type="fix" issue="NET-223">
the data connection socket is not closed when an IOException
occurred
</action>
+ <action dev="sebb" type="fix" issue="NET-231">
+ ParserInitializationException when connecting to a Unix FTP
server: comparison string must be upper case
+ Added check for AS/400 response.
+ </action>
</release>
<release version="1.4.1" date="December 3, 2005"
description="fix release to restore jdk 1.3 compatability">