<!--  RSS generated by JIRA (Enterprise Edition, Version: 3.12.2-#300) at Mon Oct 27 17:25:03 PDT 2008 -->
<!-- If you wish to do custom client-side styling of RSS, uncomment this:
<?xml-stylesheet href="http://issues.apache.org/jira/styles/jiraxml2html.xsl" type="text/xsl"?>
-->
<rss version="0.92" >
<channel>
    <title>ASF JIRA</title>
    <link>http://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&amp;pid=12310487&amp;status=6&amp;resolution=1&amp;sorter/field=created&amp;sorter/order=DESC&amp;sorter/field=priority&amp;sorter/order=DESC</link>
    <description>An XML representation of a search request</description>
    <language>en-uk</language>
<item>
<title>[NET-98] SMTP won&apos;t work under non-ASCII platforms</title>
<link>http://issues.apache.org/jira/browse/NET-98</link>

                    <description>The SMTP code doesn&apos;t work on EBCDIC platforms (like IBM os/390) because it &lt;br/&gt;
sends the commands in the default platform encoding instead of forcing it to be &lt;br/&gt;
ASCII.

&lt;p&gt;I&apos;ve tested it with an application running on OS/390 trying to do SMTP with a &lt;br/&gt;
Domino server also running on OS/390 and it doesn&apos;t work because the server &lt;br/&gt;
expects ASCII encoding even if it is running on an EBCDIC platform.&lt;/p&gt;

&lt;p&gt;It is specified in the SMTP protocol that the commands/responses must be &lt;br/&gt;
encoded in ASCII.&lt;/p&gt;

&lt;p&gt;I&apos;ve made it work locally by changing the calls to open the input/output &lt;br/&gt;
streams in the com.oroinc.net.smtp.SMTP.&lt;em&gt;connectAction&lt;/em&gt;() method by using the &lt;br/&gt;
respective constructors accepting an encoding as the second parameter and by &lt;br/&gt;
specifying this encoding to be &quot;Cp850&quot;.  The code changes still works on a &lt;br/&gt;
Win2K platform.&lt;/p&gt;

&lt;p&gt;I suspect there might be other platforms and/or other protocols that are &lt;br/&gt;
affected.&lt;/p&gt;</description>
                <environment>Operating System: other&lt;br/&gt;
Platform: Other</environment>
            <key id="12340923">NET-98</key>
        <summary>SMTP won&apos;t work under non-ASCII platforms</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="1" iconUrl="http://issues.apache.org/jira/images/icons/priority_blocker.gif">Blocker</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="fasselin@ca.ibm.com">fasselin</reporter>
            
    <created>Fri, 22 Aug 2003 13:24:08 -0700 (PDT)</created>
    <updated>Wed, 17 May 2006 19:48:54 -0700 (PDT)</updated>

                
                
                
            <due></due>
    
            <votes>1</votes>
    
                                        

            <comments>
                    <comment id="12404916" author="dfs@apache.org" created="Tue, 26 Aug 2003 05:48:28 -0700 (PDT)"  >I changed SMTP and other classes (POP3, NNTP, FTP) to use an 8-bit US-ASCII&lt;br/&gt;
superset (ISO-8859-1) for protocol communication.  Please verify the fix&lt;br/&gt;
works for you and I will close out the report and mark it as resolved.&lt;br/&gt;
Thank you very much for bringing this issue to light.</comment>
                    <comment id="12404917" author="fasselin@ca.ibm.com" created="Tue, 26 Aug 2003 12:18:42 -0700 (PDT)"  >I&apos;ve testing the changes running the new STMP code on a Win2K PC and also on &lt;br/&gt;
OS/390 (both talking to a Domino server running on OS/390) and it works.

&lt;p&gt;Thanks for the quick fix.&lt;/p&gt;</comment>
                    <comment id="12412238" author="bayard" created="Wed, 17 May 2006 19:48:54 -0700 (PDT)"  >Housekeeping due to oddities in the migration.</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>22656</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-27] FTPClient getSystem method call returns null value on VMS system</title>
<link>http://issues.apache.org/jira/browse/NET-27</link>

                    <description>FTPClient getSystem method call returns null value on VMS systems.

&lt;p&gt;This command is successfully processed by server, and its response was &quot;200 VMS &lt;br/&gt;
OpenVMS 7.2 ......&quot;.&lt;/p&gt;

&lt;p&gt;getSystem method is waiting only for &quot;215&quot; (SYSTEM_NAME) response, but &quot;200&quot; is &lt;br/&gt;
an other right response (COMMAND_OK).&lt;/p&gt;</description>
                <environment>Operating System: other&lt;br/&gt;
Platform: All</environment>
            <key id="12340875">NET-27</key>
        <summary>FTPClient getSystem method call returns null value on VMS system</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="1" iconUrl="http://issues.apache.org/jira/images/icons/priority_blocker.gif">Blocker</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="sestegra@free.fr">St&#233;phane ESTE-GRACIAS</reporter>
            
    <created>Mon, 28 Jul 2003 17:20:43 -0700 (PDT)</created>
    <updated>Wed, 19 Sep 2007 22:31:06 -0700 (PDT)</updated>

                        <version>1.0</version>
            
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12404762" author="dfs@apache.org" created="Tue, 29 Jul 2003 02:48:13 -0700 (PDT)"  >Technically, the server should only send a 215 response, but we live in the&lt;br/&gt;
real world where all things are not as they should be so I just changed the&lt;br/&gt;
code to accept a positive completion (any 2xx response).  That should fix&lt;br/&gt;
the problem without breaking anything for anyone else.</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>21937</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-102] [net] FTP: NoSuchMethodError thrown when sending command to disconnected FTP server</title>
<link>http://issues.apache.org/jira/browse/NET-102</link>

                    <description>&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;This bug only happens when running under JDK1.3.x or lower.&lt;br/&gt;
  (when running under JDK1.4.x or higher, this bug does not happen)&lt;/li&gt;
	&lt;li&gt;Create and configure an FTP server. Make sure it runs OK.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Create a program and run it under JDK1.3.x or lower:&lt;br/&gt;
=== Test Program ===================================&lt;br/&gt;
...&lt;br/&gt;
...&lt;br/&gt;
// Connect to the above FTP server and login&lt;br/&gt;
// Check that everything went fine.&lt;br/&gt;
...&lt;br/&gt;
while (true)&lt;br/&gt;
{&lt;br/&gt;
    try {
        FTPFile[] files = ftpClient.listFiles(&quot;*&quot;);
        showFiles(files);
    }&lt;br/&gt;
    catch (FTPConnectionClosedException fcce) {
        // Oops.. the FTP server has been disconnected.
        System.out.println(&quot;Disconnected from FTP Server. Ending prog.&quot;);
        break; // while(true)
    }&lt;br/&gt;
    Thread.sleep(3000);&lt;br/&gt;
}&lt;br/&gt;
... // close/disconnect and clean-up.&lt;br/&gt;
...&lt;br/&gt;
====================================================&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Run the above program. The ftpClient.listFiles(...) works OK.&lt;/li&gt;
	&lt;li&gt;At some point, stop the FTP server.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;=== Expected result: ===============================&lt;br/&gt;
Program ends normally with message &quot;Disconnected from FTP Server. Ending prog.&quot;&lt;br/&gt;
====================================================&lt;/p&gt;

&lt;p&gt;=== Actual result: =================================&lt;br/&gt;
Pogram throws java.lang.NoSuchMethodError.&lt;br/&gt;
====================================================&lt;/p&gt;

&lt;p&gt;=== Stacktrace: ====================================&lt;br/&gt;
java.lang.NoSuchMethodError&lt;br/&gt;
	at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:442)&lt;br/&gt;
	at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:484)&lt;br/&gt;
	at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:533)&lt;br/&gt;
	at org.apache.commons.net.ftp.FTP.pasv(FTP.java:833)&lt;br/&gt;
	at org.apache.commons.net.ftp.FTPClient.&lt;em&gt;openDataConnection&lt;/em&gt;&lt;br/&gt;
(FTPClient.java:493)&lt;br/&gt;
	at org.apache.commons.net.ftp.FTPClient.initiateListParsing&lt;br/&gt;
(FTPClient.java:2356)&lt;br/&gt;
	at org.apache.commons.net.ftp.FTPClient.initiateListParsing&lt;br/&gt;
(FTPClient.java:2330)&lt;br/&gt;
	at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2072)&lt;br/&gt;
	at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2123)&lt;br/&gt;
====================================================&lt;/p&gt;

&lt;p&gt;=== Probable cause: ================================&lt;br/&gt;
The FTP.sendCommand(...) method, on line 442 is as follows:&lt;/p&gt;

&lt;p&gt;    if (!isConnected() || &lt;em&gt;socket&lt;/em&gt; == null || !&lt;em&gt;socket&lt;/em&gt;.isConnected())&lt;/p&gt;

&lt;p&gt;The &apos;&lt;em&gt;socket&lt;/em&gt;&apos; variable is of type &apos;java.net.Socket&apos;.&lt;br/&gt;
Under JKD1.3, the &apos;java.net.Socket&apos; class does NOT implement &apos;isConnected()&apos;.&lt;br/&gt;
====================================================&lt;/p&gt;

&lt;p&gt;Why this bug is &quot;P1 &amp;amp; critical&quot;: If the FTP Server closed the connection (e.g. &lt;br/&gt;
due to a time-out), our code catches the FTPConnectionClosedException exception &lt;br/&gt;
and tries to reconnect to the server. If this exception is not thrown, but the &lt;br/&gt;
NoSuchMethodError is thrown instead, our code fails.&lt;/p&gt;

&lt;p&gt;PS: It is hard to find information about which JDK-versions support the &lt;br/&gt;
Commons/Net component. This page (&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://jakarta.apache.org/commons/net/changes-&quot;&gt;http://jakarta.apache.org/commons/net/changes-&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;br/&gt;
report.html#1_3_0), indicates that the component should run correctly at least &lt;br/&gt;
under JDK1.3.x.&lt;/p&gt;</description>
                <environment>Operating System: Windows 2000&lt;br/&gt;
Platform: PC</environment>
            <key id="12342104">NET-102</key>
        <summary>[net] FTP: NoSuchMethodError thrown when sending command to disconnected FTP server</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="2" iconUrl="http://issues.apache.org/jira/images/icons/priority_critical.gif">Critical</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="aspaans@smarttime.com">Anton Spaans</reporter>
            
    <created>Wed, 9 Mar 2005 23:58:07 -0800 (PST)</created>
    <updated>Wed, 19 Sep 2007 22:31:16 -0700 (PDT)</updated>

                        <version>1.3</version>
            
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12408865" author="aspaans@smarttime.com" created="Thu, 10 Mar 2005 00:18:44 -0800 (PST)"  >I&apos;m not sure, but it looks like that this bug is related to the fix/patch for &lt;br/&gt;
COM-1663 (the patch from &quot;2004-12-30 08:57&quot; never made it into version &lt;br/&gt;
1.3.Final...?).</comment>
                    <comment id="12408866" author="rwinston@eircom.net" created="Fri, 15 Apr 2005 16:01:25 -0700 (PDT)"  >Patch applied.</comment>
                </comments>
    
    <issuelinks>
                <issuelinktype id="12310030">
            <name>Dependency</name>
                            <outwardlinks description="depends on">
                            <issuelink>
            <issuekey id="12341815">NET-120</issuekey>
        </issuelink>
                    </outwardlinks>
                                </issuelinktype>
            </issuelinks>
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>33942</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-60] commons-net 1.2 incompatible with JDK &lt; 1.4</title>
<link>http://issues.apache.org/jira/browse/NET-60</link>

                    <description>&amp;lt;raghu.changlaveedu@bt.com&amp;gt;&lt;br/&gt;
&amp;gt; I got this error when using JDK 1.3.1_09&lt;br/&gt;
&amp;gt; version.&lt;br/&gt;
&amp;gt;&lt;br/&gt;
&amp;gt; java.lang.IllegalAccessError: try to access method&lt;br/&gt;
&amp;gt; java.util.Calendar.getTimeInMillis()J from class &lt;br/&gt;
&amp;gt; org.apache.commons.net.ftp.parser.NTFTPEntryParser

&lt;p&gt;&quot;Edelson, Justin&quot; &amp;lt;Justin.Edelson@mtvi.com&amp;gt;:&lt;br/&gt;
&amp;gt;However, net 1.2 won&apos;t compile against anything prior to 1.4 (I&apos;m&lt;br/&gt;
&amp;gt;working with 1.3.1) because&lt;br/&gt;
&amp;gt;org.apache.commons.net.ftp.parser.NTFTPEntryParser tries to call&lt;br/&gt;
&amp;gt;Calendar.getTimeInMillis() on line 132, which prior to 1.4 was a&lt;br/&gt;
&amp;gt;protected method.&lt;/p&gt;</description>
                <environment>Operating System: All&lt;br/&gt;
Platform: All</environment>
            <key id="12341432">NET-60</key>
        <summary>commons-net 1.2 incompatible with JDK &lt; 1.4</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="2" iconUrl="http://issues.apache.org/jira/images/icons/priority_critical.gif">Critical</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="scohen@apache.org">Steve Cohen</reporter>
            
    <created>Tue, 4 May 2004 22:41:17 -0700 (PDT)</created>
    <updated>Wed, 19 Sep 2007 22:31:10 -0700 (PDT)</updated>

                        <version>1.2</version>
            
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12406545" author="scohen@apache.org" created="Tue, 4 May 2004 22:43:17 -0700 (PDT)"  >Additionally, I discover that TelnetClientTest.java does not compile under 1.2.</comment>
                    <comment id="12406546" author="scohen@apache.org" created="Tue, 4 May 2004 22:45:25 -0700 (PDT)"  >checked in fix</comment>
                    <comment id="12406547" author="scohen@apache.org" created="Sat, 26 Jun 2004 02:10:51 -0700 (PDT)"  >&lt;ul&gt;
	&lt;li&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;ul&gt;
			&lt;li&gt;COM-1281 has been marked as a duplicate of this bug. ***&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>28775</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-44] FTP get actions won&apos;t download files</title>
<link>http://issues.apache.org/jira/browse/NET-44</link>

                    <description>The FTP get action returns success but does not get files.

&lt;p&gt;Environment:&lt;br/&gt;
------------&lt;br/&gt;
ant 1.6.0 (downloaded December 18th)&lt;br/&gt;
Windows 2000 Server&lt;br/&gt;
JAVA_HOME=c:\jsdk1.4.1_02&lt;br/&gt;
ANT_HOME=c:\ant1.6&lt;br/&gt;
ANT_OPTS=-Xmx128m&lt;br/&gt;
ClassPath=c:\ant1.6\apache-ant-1.6.0\lib&lt;/p&gt;


&lt;p&gt;Steps to reproduce:&lt;br/&gt;
-------------------&lt;br/&gt;
1. Create an anonymous ftp server on a windows localhost &lt;br/&gt;
2. Create the following target (substitute the server and login credentials as &lt;br/&gt;
necessary):&lt;/p&gt;

&lt;p&gt;&amp;lt;target name=&quot;downloadftp&quot;&amp;gt; &lt;br/&gt;
  &amp;lt;ftp action=&quot;get&quot;&lt;br/&gt;
	server=&quot;krothe&quot;&lt;br/&gt;
	userid=&quot;anonymous&quot;&lt;br/&gt;
	password=&quot;&quot;&lt;br/&gt;
	verbose=&quot;yes&quot;&lt;br/&gt;
	passive=&quot;yes&quot;&lt;br/&gt;
	separator=&quot;\&quot;&lt;br/&gt;
    &amp;lt;fileset dir=&quot;c:\&quot;&amp;gt;&lt;br/&gt;
	&amp;lt;include name=&quot;linux.md5&quot;/&amp;gt;&lt;br/&gt;
    &amp;lt;/fileset&amp;gt;&lt;br/&gt;
  &amp;lt;/ftp&amp;gt;&lt;br/&gt;
&amp;lt;/target&amp;gt;&lt;/p&gt;

&lt;p&gt;3. run the following ant command from the location of your build.xml:&lt;br/&gt;
ant downloadftp&lt;/p&gt;

&lt;p&gt;Note that the following output appears on std. out:&lt;/p&gt;

&lt;p&gt;downloadftp:&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;ftp&amp;#93;&lt;/span&gt; getting files&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;ftp&amp;#93;&lt;/span&gt; 0 files retrieved&lt;/p&gt;

&lt;p&gt;BUILD SUCCESSFUL&lt;br/&gt;
Total Time: 2 seconds&lt;/p&gt;


&lt;p&gt;No matter what settings I try the get action does not work.&lt;/p&gt;</description>
                <environment>Operating System: All&lt;br/&gt;
Platform: PC</environment>
            <key id="12341168">NET-44</key>
        <summary>FTP get actions won&apos;t download files</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="2" iconUrl="http://issues.apache.org/jira/images/icons/priority_critical.gif">Critical</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="krothe@merc-int.com">Kirk Rothe</reporter>
            
    <created>Fri, 19 Dec 2003 22:18:00 -0800 (PST)</created>
    <updated>Wed, 19 Sep 2007 22:31:08 -0700 (PDT)</updated>

                        <version>Nightly Builds</version>
            
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12405700" author="antoine@apache.org" created="Sat, 20 Dec 2003 12:54:14 -0800 (PST)"  >Hi,

&lt;p&gt;what is the default directory for the user anonymous when logging on to your ftp&lt;br/&gt;
server ?&lt;br/&gt;
if the default directory is not &quot;C:\&quot;, you need to specify a remotedir.&lt;br/&gt;
Pay attention, when doing a &amp;lt;ftp action=&quot;get&quot; .../&amp;gt; , the basedir of the nested&lt;br/&gt;
fileset does not count, only the include/exclude patterns of the fileset are used.&lt;br/&gt;
The remotedir attribute will tell the ftp task where to cd to.&lt;/p&gt;

&lt;p&gt;Cheers,&lt;br/&gt;
Antoine&lt;/p&gt;</comment>
                    <comment id="12405701" author="antoine@apache.org" created="Tue, 15 Jun 2004 21:25:22 -0700 (PDT)"  >can you specify which version of commons-net you are using ?</comment>
                    <comment id="12405702" author="scohen@apache.org" created="Wed, 16 Jun 2004 23:29:31 -0700 (PDT)"  >transferred bug to commons-net, where it will now be fixed.</comment>
                    <comment id="12405703" author="scohen@apache.org" created="Sun, 20 Jun 2004 18:25:41 -0700 (PDT)"  >&lt;ul&gt;
	&lt;li&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;ul&gt;
			&lt;li&gt;COM-1370 has been marked as a duplicate of this bug. ***&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>25668</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-216] KeyManager and TrustManager not used for data socket</title>
<link>http://issues.apache.org/jira/browse/NET-216</link>

                    <description>When setting the KeyManager and TrustManager for FtpsClient, it will not be used for the data connection. In addition, the current code eats an exception and just dumps it to stderr. </description>
                <environment></environment>
            <key id="12394763">NET-216</key>
        <summary>KeyManager and TrustManager not used for data socket</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="niklas">Niklas Gustavsson</reporter>
            
    <created>Thu, 24 Apr 2008 23:47:04 -0700 (PDT)</created>
    <updated>Sun, 27 Apr 2008 15:06:23 -0700 (PDT)</updated>

                        <version>2.0</version>
            
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12592289" author="niklas" created="Thu, 24 Apr 2008 23:47:57 -0700 (PDT)"  >Attaching patch for this issue</comment>
                    <comment id="12592357" author="grimsell" created="Fri, 25 Apr 2008 05:15:55 -0700 (PDT)"  >Same as Niklas patch but will compile on jdk 1.5.</comment>
                    <comment id="12592685" author="rwinston@eircom.net" created="Sun, 27 Apr 2008 15:06:23 -0700 (PDT)"  >Patch applied. Thanks.</comment>
                </comments>
    
    <attachments>
            <attachment id="12380927" name="NET-216-jdk1.5.patch" size="3132" author="grimsell" created="Fri, 25 Apr 2008 05:15:55 -0700 (PDT)" />
            <attachment id="12380898" name="NET-216.patch" size="2977" author="niklas" created="Thu, 24 Apr 2008 23:47:56 -0700 (PDT)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-208] TelnetInputStream swallows interruptedexception as IOException</title>
<link>http://issues.apache.org/jira/browse/NET-208</link>

                    <description>The TelnetInputStream catches InterruptedException in the read() method (line 342) and throws a new IOException without wrapping the InterruptedException. This means that the fact that the read() method was interrupted can hardly be distinguished from any other IOException.

&lt;p&gt;I use thread interruption as a cancellation mechanism for a thread that uses the TelnetInputStream to read data.&lt;/p&gt;

&lt;p&gt;The read method is not allowed to throw InterruptedException, so I propose to fix it by at least wrapping the underlying InterruptedException:&lt;/p&gt;

&lt;p&gt;catch (InterruptedException e)&lt;/p&gt;
{
    throw new IOException(&quot;Fatal thread interruption during read.&quot;, e);
}</description>
                <environment></environment>
            <key id="12392322">NET-208</key>
        <summary>TelnetInputStream swallows interruptedexception as IOException</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="jvb">Jan Van Besien</reporter>
            
    <created>Wed, 26 Mar 2008 02:14:02 -0700 (PDT)</created>
    <updated>Fri, 16 May 2008 16:19:15 -0700 (PDT)</updated>

                        <version>1.4</version>
            
                        <fixVersion>2.0</fixVersion>
                    <fixVersion>1.5</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12582212" author="joehni" created="Wed, 26 Mar 2008 02:51:04 -0700 (PDT)"  >Maybe it is a better choice to throw an java.io.InterruptedIOException instead. Such an exception might be thrown anyway (depending on the platform in use).</comment>
                    <comment id="12582240" author="jvb" created="Wed, 26 Mar 2008 04:03:42 -0700 (PDT)"  >I agree, InterruptedIOException would be better.</comment>
                    <comment id="12597463" author="sebb@apache.org" created="Fri, 16 May 2008 06:03:13 -0700 (PDT)"  >The bug was raised against 1.4 - so the fix version should include 1.5, no?</comment>
                    <comment id="12597609" author="rwinston@eircom.net" created="Fri, 16 May 2008 13:53:15 -0700 (PDT)"  >Hi Sebb

&lt;p&gt;Indeed it should - I just tentatively wanted to make sure that IIOE was present pre JDK-1.5, which I didnt have the opportunity to check at the time. Looks like its been there since the beginning!&lt;/p&gt;</comment>
                    <comment id="12597653" author="sebb@apache.org" created="Fri, 16 May 2008 16:19:15 -0700 (PDT)"  >Applied to 2.0 as well:

&lt;p&gt;URL: &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://svn.apache.org/viewvc?rev=657247&amp;amp;view=rev&quot;&gt;http://svn.apache.org/viewvc?rev=657247&amp;amp;view=rev&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;br/&gt;
Log:&lt;br/&gt;
&lt;a href=&quot;http://issues.apache.org/jira/browse/NET-208&quot; title=&quot;TelnetInputStream swallows interruptedexception as IOException&quot;&gt;&lt;del&gt;NET-208&lt;/del&gt;&lt;/a&gt; - TelnetInputStream swallows interruptedException as IOException&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;Copy of r657221&amp;#93;&lt;/span&gt;&lt;/p&gt;</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-206] Turkish &apos;i&apos; problem and ParserInitializationException: Unknown parser type: Windows_NT</title>
<link>http://issues.apache.org/jira/browse/NET-206</link>

                    <description>When default locale of a JVM is set to tr_TR with the UTF-8 encoding the following error is seen when connecting to windows ftp server:&lt;br/&gt;
...&lt;br/&gt;
at org.apache.commons.net.ftp.parser.ParserInitializationException: Unknown parser type: Windows_NT&lt;br/&gt;
at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createFileEntryParser(DefaultFTPFileEntryParserFactory.java:118)&lt;br/&gt;
at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2358)&lt;br/&gt;
at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2141)&lt;br/&gt;
at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2188)&lt;br/&gt;
...</description>
                <environment>Linux, JRE1.5</environment>
            <key id="12391616">NET-206</key>
        <summary>Turkish &apos;i&apos; problem and ParserInitializationException: Unknown parser type: Windows_NT</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="bodik">Bohdan Bobylak</reporter>
            
    <created>Mon, 17 Mar 2008 05:47:24 -0700 (PDT)</created>
    <updated>Fri, 16 May 2008 02:20:43 -0700 (PDT)</updated>

                        <version>1.4</version>
            
                        <fixVersion>2.0</fixVersion>
                    <fixVersion>1.5</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12579421" author="bodik" created="Mon, 17 Mar 2008 05:51:08 -0700 (PDT)"  >Patch that fixies the issue.</comment>
                    <comment id="12579437" author="sebb@apache.org" created="Mon, 17 Mar 2008 06:22:37 -0700 (PDT)"  >This will also affect the 2.0 code.

&lt;p&gt;Are there any other Locale-dependent calls which assume an English Locale?  e.g. toLowerCase()&lt;/p&gt;

&lt;p&gt;It looks like String.equalsIgnoreCase() does not use Locales.&lt;/p&gt;</comment>
                    <comment id="12586193" author="sebb@apache.org" created="Sun, 6 Apr 2008 15:38:31 -0700 (PDT)"  >Patch applied to trunk:&lt;br/&gt;
    &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://svn.apache.org/viewvc?rev=645320&amp;amp;view=rev&quot;&gt;http://svn.apache.org/viewvc?rev=645320&amp;amp;view=rev&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;br/&gt;
and &lt;br/&gt;
net 2.0 branch:  &lt;br/&gt;
   &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://svn.apache.org/viewvc?rev=645321&amp;amp;view=rev&quot;&gt;http://svn.apache.org/viewvc?rev=645321&amp;amp;view=rev&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;
</comment>
                </comments>
    
    <attachments>
            <attachment id="12378032" name="DefaultFTPFileEntryParserFactory.patch" size="720" author="bodik" created="Mon, 17 Mar 2008 05:51:08 -0700 (PDT)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-201] UnixFTPEntryParser does not handle character/block special devices properly</title>
<link>http://issues.apache.org/jira/browse/NET-201</link>

                    <description>The following is a valid entry from a FreeBSD system:

&lt;p&gt;      crw-r-----  1 root      kmem        0,  27 Jan 30 11:42 kmem&lt;/p&gt;

&lt;p&gt;This causes a parse error, because the regular expression does not allow for the major and minor device numbers.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12390609">NET-201</key>
        <summary>UnixFTPEntryParser does not handle character/block special devices properly</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="sebb@apache.org">Sebb</reporter>
            
    <created>Sun, 9 Mar 2008 13:20:59 -0700 (PDT)</created>
    <updated>Sun, 16 Mar 2008 14:46:13 -0700 (PDT)</updated>

                
                        <fixVersion>2.0</fixVersion>
                    <fixVersion>1.5</fixVersion>
            
                
            <due></due>
    
            <votes>1</votes>
    
                                        

            <comments>
                    <comment id="12579189" author="moberhuber" created="Sun, 16 Mar 2008 06:21:06 -0700 (PDT)"  >We found the same issue on a Solaris server a while back, and resorted to a workaround of not showing the file (because we reckoned that users cannot do much with a character special device anyways).

&lt;p&gt;The point is that Commons Net throws a parse exception, because it expects a single number (&quot;size&quot;) where it finds the device numbers (&quot;0, 27&quot;). What we did is catch the exception and ignore the file. See &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://bugs.eclipse.org/bugs/show_bug.cgi?id=197105&quot;&gt;https://bugs.eclipse.org/bugs/show_bug.cgi?id=197105&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;A possible fix should be in UnixFTPEntryParser.java line 94, replace&lt;br/&gt;
        + &quot;(\\d+)&lt;br clear=&quot;all&quot; /&gt;s+&quot;  &lt;br/&gt;
by&lt;br/&gt;
        + &quot;(\\d+(?:,\\s*\\d+)?)&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;/p&gt;

&lt;p&gt;This will result in a valid FTPFile with size=0 and valid raw listing attached. I do not think that it is worth changing the FTPFile API to have separate fields for the major and minor numbers.&lt;/p&gt;</comment>
                    <comment id="12579190" author="moberhuber" created="Sun, 16 Mar 2008 06:40:23 -0700 (PDT)"  >Attached patch + unittests.&lt;br/&gt;
May I vote for this to be applied for the upcoming 1.5 release?</comment>
                    <comment id="12579241" author="rwinston@eircom.net" created="Sun, 16 Mar 2008 13:03:15 -0700 (PDT)"  >Martin

&lt;p&gt;That sounds reasonable to me  - I&apos;ll apply to 1.5 and 2.0 now and then we can verify and test. &lt;/p&gt;</comment>
                    <comment id="12579246" author="rwinston@eircom.net" created="Sun, 16 Mar 2008 13:18:52 -0700 (PDT)"  >Applied.</comment>
                    <comment id="12579266" author="sebb@apache.org" created="Sun, 16 Mar 2008 14:46:14 -0700 (PDT)"  >Seems to be similar to &lt;a href=&quot;http://issues.apache.org/jira/browse/NET-25&quot; title=&quot;[net] Unix parser does not handle special files.&quot;&gt;&lt;del&gt;NET-25&lt;/del&gt;&lt;/a&gt;</comment>
                </comments>
    
    <issuelinks>
                <issuelinktype id="10030">
            <name>Reference</name>
                                        <inwardlinks description="is related to">
                            <issuelink>
            <issuekey id="12341526">NET-25</issuekey>
        </issuelink>
                    </inwardlinks>
                    </issuelinktype>
            </issuelinks>
    <attachments>
            <attachment id="12377996" name="FTPParse_specialDevices.patch" size="1825" author="moberhuber" created="Sun, 16 Mar 2008 06:40:23 -0700 (PDT)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-198] FTPTimestampParserImpl#parseTimeStamp() is not fully testable</title>
<link>http://issues.apache.org/jira/browse/NET-198</link>

                    <description>The FTPTimestampParserImpl#parseTimeStamp() method is not fully testable, because it unconditionally creates Calendar items using the current time.

&lt;p&gt;In order to test for leap years and DST, the test code needs to be able to set arbitrary times.&lt;/p&gt;

&lt;p&gt;I suggest adding a package-private method that takes an additional Calendar parameter, as follows:&lt;/p&gt;

&lt;p&gt;	Calendar parseTimestamp(String timestampStr, Calendar now) throws ParseException {&lt;br/&gt;
        // etc&lt;/p&gt;

&lt;p&gt;This would replace the original code; the public interface would delegate to the package-private method:&lt;/p&gt;

&lt;p&gt;	public Calendar parseTimestamp(String timestampStr) throws ParseException {
		Calendar now = Calendar.getInstance();
		return parseTimestamp(timestampStr, now);
	}&lt;/p&gt;

&lt;p&gt;Patch to follow.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12390526">NET-198</key>
        <summary>FTPTimestampParserImpl#parseTimeStamp() is not fully testable</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="sebb@apache.org">Sebb</reporter>
            
    <created>Sat, 8 Mar 2008 02:09:31 -0800 (PST)</created>
    <updated>Sun, 9 Mar 2008 15:45:45 -0700 (PDT)</updated>

                
                        <fixVersion>2.0</fixVersion>
                    <fixVersion>1.5</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12576522" author="sebb@apache.org" created="Sat, 8 Mar 2008 02:14:26 -0800 (PST)"  >It&apos;s not possible to test fixes to &lt;a href=&quot;http://issues.apache.org/jira/browse/NET-188&quot; title=&quot;FTPClient#listFiles returns null element when file&apos;s timestamp is &amp;quot;02/29&amp;quot;&quot;&gt;&lt;del&gt;NET-188&lt;/del&gt;&lt;/a&gt; without this patch</comment>
                    <comment id="12576794" author="sebb@apache.org" created="Sun, 9 Mar 2008 09:52:47 -0700 (PDT)"  >Patch needs adjusting</comment>
                    <comment id="12576795" author="sebb@apache.org" created="Sun, 9 Mar 2008 09:55:59 -0700 (PDT)"  >The original patch was changed slightly when it was applied, and one of the lines was moved to the wrong method.

&lt;p&gt;Also, it&apos;s important that the fix to the year is taken from the provided year, not the current year (which may be different in testing).&lt;br/&gt;
This was omitted in the original patch.&lt;/p&gt;</comment>
                </comments>
    
    <issuelinks>
                <issuelinktype id="10032">
            <name>Blocker</name>
                            <outwardlinks description="blocks">
                            <issuelink>
            <issuekey id="12389468">NET-188</issuekey>
        </issuelink>
                    </outwardlinks>
                                </issuelinktype>
            </issuelinks>
    <attachments>
            <attachment id="12377433" name="FTPTimestampParserImpl.patch" size="947" author="sebb@apache.org" created="Sat, 8 Mar 2008 02:12:20 -0800 (PST)" />
            <attachment id="12377485" name="FTPTimestampParserImpl2.patch" size="1469" author="sebb@apache.org" created="Sun, 9 Mar 2008 09:55:59 -0700 (PDT)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-193] FTP throw NullPointerException when enountering 02-29-2008 (leap year bug)</title>
<link>http://issues.apache.org/jira/browse/NET-193</link>

                    <description>ant FTP task blowing up when parsing directories containing ANY items dated (created/modified) February 29 2008.

&lt;p&gt;There may be a workaround using defaultDateFormatConfig or recentDateFormatConfig - but I didn&apos;t find it (actually by messing with some of the ftp attributes my build finally stopped throwing NullPointerExceptions, but refused to list or get any files!!  Always came back with 0 files found)&lt;/p&gt;

&lt;p&gt;Not sure the date format used by Windows FTP server - One thing I am sure of:  tasks that once worked stopped working on Friday - it took all weekend and most of today to figure it out.  By updating files and folders, magically ftp task begins working agains and I slowly begin regain my sanity &lt;/p&gt;

&lt;p&gt;Here&apos;s the exception:&lt;br/&gt;
D:\builds\build.xml:23: java.lang.NullPointerException&lt;br/&gt;
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:115)&lt;br/&gt;
        at org.apache.tools.ant.Task.perform(Task.java:348)&lt;br/&gt;
        at org.apache.tools.ant.Target.execute(Target.java:357)&lt;br/&gt;
        at org.apache.tools.ant.Target.performTasks(Target.java:385)&lt;br/&gt;
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)&lt;br/&gt;
        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)&lt;br/&gt;
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)&lt;br/&gt;
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)&lt;br/&gt;
        at org.apache.tools.ant.Main.runBuild(Main.java:698)&lt;br/&gt;
        at org.apache.tools.ant.Main.startAnt(Main.java:199)&lt;br/&gt;
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)&lt;br/&gt;
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)&lt;br/&gt;
Caused by: java.lang.NullPointerException&lt;br/&gt;
        at org.apache.tools.ant.taskdefs.optional.net.FTP$FTPDirectoryScanner.scandir(FTP.java:374)&lt;br/&gt;
        at org.apache.tools.ant.taskdefs.optional.net.FTP$FTPDirectoryScanner.accountForIncludedDir(FTP.java:459)&lt;br/&gt;
        at org.apache.tools.ant.taskdefs.optional.net.FTP$FTPDirectoryScanner.scandir(FTP.java:383)&lt;br/&gt;
        at org.apache.tools.ant.taskdefs.optional.net.FTP$FTPDirectoryScanner.checkIncludePatterns(FTP.java:270)&lt;br/&gt;
        at org.apache.tools.ant.taskdefs.optional.net.FTP$FTPDirectoryScanner.scan(FTP.java:233)&lt;br/&gt;
        at org.apache.tools.ant.taskdefs.optional.net.FTP.transferFiles(FTP.java:1570)&lt;br/&gt;
        at org.apache.tools.ant.taskdefs.optional.net.FTP.transferFiles(FTP.java:1683)&lt;br/&gt;
        at org.apache.tools.ant.taskdefs.optional.net.FTP.execute(FTP.java:2373)&lt;br/&gt;
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)&lt;br/&gt;
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)&lt;br/&gt;
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)&lt;br/&gt;
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)&lt;br/&gt;
        at java.lang.reflect.Method.invoke(Method.java:597)&lt;br/&gt;
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)&lt;br/&gt;
        ... 11 more&lt;br/&gt;
&amp;#8212; Nested Exception &amp;#8212;&lt;br/&gt;
java.lang.NullPointerException&lt;br/&gt;
        at org.apache.tools.ant.taskdefs.optional.net.FTP$FTPDirectoryScanner.scandir(FTP.java:374)&lt;br/&gt;
        at org.apache.tools.ant.taskdefs.optional.net.FTP$FTPDirectoryScanner.accountForIncludedDir(FTP.java:459)&lt;br/&gt;
        at org.apache.tools.ant.taskdefs.optional.net.FTP$FTPDirectoryScanner.scandir(FTP.java:383)&lt;br/&gt;
        at org.apache.tools.ant.taskdefs.optional.net.FTP$FTPDirectoryScanner.checkIncludePatterns(FTP.java:270)&lt;br/&gt;
        at org.apache.tools.ant.taskdefs.optional.net.FTP$FTPDirectoryScanner.scan(FTP.java:233)&lt;br/&gt;
        at org.apache.tools.ant.taskdefs.optional.net.FTP.transferFiles(FTP.java:1570)&lt;br/&gt;
        at org.apache.tools.ant.taskdefs.optional.net.FTP.transferFiles(FTP.java:1683)&lt;br/&gt;
        at org.apache.tools.ant.taskdefs.optional.net.FTP.execute(FTP.java:2373)&lt;br/&gt;
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)&lt;br/&gt;
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)&lt;br/&gt;
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)&lt;br/&gt;
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)&lt;br/&gt;
        at java.lang.reflect.Method.invoke(Method.java:597)&lt;br/&gt;
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)&lt;br/&gt;
        at org.apache.tools.ant.Task.perform(Task.java:348)&lt;br/&gt;
        at org.apache.tools.ant.Target.execute(Target.java:357)&lt;br/&gt;
        at org.apache.tools.ant.Target.performTasks(Target.java:385)&lt;br/&gt;
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)&lt;br/&gt;
        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)&lt;br/&gt;
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)&lt;br/&gt;
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)&lt;br/&gt;
        at org.apache.tools.ant.Main.runBuild(Main.java:698)&lt;br/&gt;
        at org.apache.tools.ant.Main.startAnt(Main.java:199)&lt;br/&gt;
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)&lt;br/&gt;
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)&lt;/p&gt;</description>
                <environment>Ant 1.7 &lt;br/&gt;
commons-net-1.4.1&lt;br/&gt;
java 1.6.0_01&lt;br/&gt;
Windows 2003 (build machine)&lt;br/&gt;
Windows 2003 FTP server</environment>
            <key id="12390098">NET-193</key>
        <summary>FTP throw NullPointerException when enountering 02-29-2008 (leap year bug)</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="jburtram">j burtram</reporter>
            
    <created>Mon, 3 Mar 2008 14:56:16 -0800 (PST)</created>
    <updated>Sat, 8 Mar 2008 11:50:45 -0800 (PST)</updated>

                        <version>1.4</version>
            
                        <fixVersion>2.0</fixVersion>
                    <fixVersion>1.5</fixVersion>
            
                
            <due></due>
    
            <votes>2</votes>
    
                                        

    
    <issuelinks>
                <issuelinktype id="12310000">
            <name>Duplicate</name>
                            <outwardlinks description="duplicates">
                            <issuelink>
            <issuekey id="12389468">NET-188</issuekey>
        </issuelink>
                    </outwardlinks>
                                </issuelinktype>
            </issuelinks>
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-188] FTPClient#listFiles returns null element when file&apos;s timestamp is &quot;02/29&quot;</title>
<link>http://issues.apache.org/jira/browse/NET-188</link>

                    <description>This issue has same cause as &lt;a href=&quot;http://issues.apache.org/jira/browse/VALIDATOR-221&quot; title=&quot;DateValidator considers &amp;quot;02/29&amp;quot; with format &amp;quot;MM/dd&amp;quot; invalid&quot;&gt;&lt;del&gt;VALIDATOR-221&lt;/del&gt;&lt;/a&gt;.&lt;br/&gt;
org.apache.commons.net.ftp.parser.FTPTimestampParserImpl#parseTimestamp throws ParseException with timestampStr = &quot;Feb 29 11:22&quot;.

&lt;p&gt;FTP Server status:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;[root@localhost test-commonsnet]# pwd
/tmp/test-commonsnet
[root@localhost test-commonsnet]# ls -l
total 0
-rw-r--r--  1 root root 0 Dec 19  2006 aaa.txt
-rw-r--r--  1 root root 0 Feb 29 11:22 bbb.txt&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;test code:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; void testCommonsNetLeapDay() &lt;span class=&quot;code-keyword&quot;&gt;throws&lt;/span&gt; Exception {
    &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; FTPClient ftp = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; FTPClient();
    ftp.connect(host);
    ftp.login(user, password);
    &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; FTPFile[] listFiles = ftp.listFiles(&lt;span class=&quot;code-quote&quot;&gt;&quot;/tmp/test-commonsnet&quot;&lt;/span&gt;);
    &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; i = 0; i &amp;lt; listFiles.length; i++) {
        &lt;span class=&quot;code-object&quot;&gt;System&lt;/span&gt;.out.println(&lt;span class=&quot;code-quote&quot;&gt;&quot;[&quot;&lt;/span&gt; + i + &lt;span class=&quot;code-quote&quot;&gt;&quot;] &quot;&lt;/span&gt; + listFiles[i]);
    }
    ftp.disconnect();
}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;results bellow.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;[0] -rw-r--r--    1 0        0               0 Dec 18  2006 aaa.txt
[1] &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Second element(bbb.txt) should not be null.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12389468">NET-188</key>
        <summary>FTPClient#listFiles returns null element when file&apos;s timestamp is &quot;02/29&quot;</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="manhole">HONMA Hirotaka</reporter>
            
    <created>Mon, 25 Feb 2008 02:22:21 -0800 (PST)</created>
    <updated>Thu, 26 Jun 2008 02:57:05 -0700 (PDT)</updated>

                        <version>1.4</version>
            
                        <fixVersion>2.0</fixVersion>
                    <fixVersion>1.5</fixVersion>
            
                
            <due></due>
    
            <votes>32</votes>
    
                                        

            <comments>
                    <comment id="12572149" author="rwinston@eircom.net" created="Mon, 25 Feb 2008 10:21:54 -0800 (PST)"  >Hmmm. This is a tough one. With no year information in the date string, SimpleDateFormat clears the internal Calendar and sets the YEAR field to 1970, the epoch  (the default). Normally, this will have no impact on date parsing, &lt;b&gt;except&lt;/b&gt; when the year in question is a leap year, as 1970 wasn&apos;t one. Thus, SDF thinks that Feb 29th should be riolled over to March 1st in lenient mode, and in strict mode (the default for Net parsing), it simply returns null.  Of course, the real culprit is the horrible Java date/time package implementation. Using something like Joda-time for this works as expected.</comment>
                    <comment id="12572158" author="rwinston@eircom.net" created="Mon, 25 Feb 2008 10:51:27 -0800 (PST)"  >Something like this would fix it (I&apos;ve tried it), but I think it&apos;s nasty:

&lt;p&gt;if (short date validation fails) &lt;br/&gt;
  explicitly add the current year to the date string&lt;br/&gt;
   Create a new non-lenient SDF instance using using the previous SDF toPattern + &quot; yyyy&quot;&lt;br/&gt;
   Attempt to parse the date&lt;/p&gt;

&lt;p&gt;Any comments? I&apos;m tempted to mark this as WONTFIX.&lt;/p&gt;</comment>
                    <comment id="12572292" author="sebb@apache.org" created="Mon, 25 Feb 2008 14:46:39 -0800 (PST)"  >The ftp directory listing output on Unix systems generally corresponds to that produced by &quot;ls -l&quot;.

&lt;p&gt;The man page for ls (e.g. on FreeBSD) says:&lt;/p&gt;

&lt;p&gt;     If the modification time of the file is more than 6 months in the past or&lt;br/&gt;
     future, then the year of the last modification is displayed in place of&lt;br/&gt;
     the hour and minute fields.&lt;/p&gt;

&lt;p&gt;So if the year is missing, why not set it according to the rule above?&lt;/p&gt;</comment>
                    <comment id="12572346" author="ashizawa@jajakarta.org" created="Mon, 25 Feb 2008 18:42:22 -0800 (PST)"  >&amp;gt;Any comments? I&apos;m tempted to mark this as WONTFIX.

&lt;p&gt;Unfortunately it will not work well, because of lack of crossover year consideration.&lt;/p&gt;

&lt;p&gt;Ex: If a file was created in Dec-2007 and current date was Jan-2008, the missing year would be 2007 (not current year).&lt;/p&gt;

&lt;p&gt;I guess this issue isn&apos;t caused by a JDK implementation.&lt;br/&gt;
I hope it will be fixed soon (not WONTFIX).&lt;/p&gt;
</comment>
                    <comment id="12572349" author="awtimmering" created="Mon, 25 Feb 2008 19:31:14 -0800 (PST)"  >A fix for this would be greatly appreciated. 

&lt;p&gt;Rory: If not in the Commons Net, where should this be addressed in your opinion?&lt;/p&gt;</comment>
                    <comment id="12572388" author="rwinston@eircom.net" created="Tue, 26 Feb 2008 01:22:44 -0800 (PST)"  >It is a JDK implementation issue. That&apos;s the whole point of the analysis.</comment>
                    <comment id="12572389" author="sebb@apache.org" created="Tue, 26 Feb 2008 01:36:53 -0800 (PST)"  >If the fie was created in Dec 2007, and it is now Jan 2008, then the year will be omitted on Unix systems.

&lt;p&gt;Since Dec is less that 6 months behind Jan, and &amp;gt; 6 months ahead, the omitted year must be 2007.&lt;/p&gt;

&lt;p&gt;Pseudocode:&lt;/p&gt;

&lt;p&gt;If year is not present&lt;br/&gt;
then &lt;br/&gt;
      calculate date using current year&lt;br/&gt;
      if date - now &amp;gt; 6 months (or calculation fails)&lt;br/&gt;
      then&lt;br/&gt;
          calculate date using previous year&lt;br/&gt;
     endif&lt;br/&gt;
endif&lt;/p&gt;</comment>
                    <comment id="12572391" author="sebb@apache.org" created="Tue, 26 Feb 2008 01:43:30 -0800 (PST)"  >@Rory: I don&apos;t agree that it&apos;s a JDK problem. 

&lt;p&gt;SimpleDateFormat may not be as flexible as one might want, but it&apos;s not its fault that it cannot handle all partially specified dates.&lt;/p&gt;</comment>
                    <comment id="12572392" author="rwinston@eircom.net" created="Tue, 26 Feb 2008 01:50:12 -0800 (PST)"  >That should work. I do think this will only happen in the case of Feb 29th , in which case we dont need to check the year, as it will always be the current year.  </comment>
                    <comment id="12572396" author="sebb@apache.org" created="Tue, 26 Feb 2008 02:02:34 -0800 (PST)"  >Agreed Feb 29 cannot be the previous year as it is more than 6 months from the end of the year.

&lt;p&gt;It could potentially be the next year - if the system clock has been turned back, or the file is future-dated.&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;I assume the original example must have been created by future-dating a file&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;However the most common case is that Feb 29 will be the current year.&lt;/p&gt;</comment>
                    <comment id="12572448" author="rwinston@eircom.net" created="Tue, 26 Feb 2008 04:14:07 -0800 (PST)"  >Something like this would work, if the initial recent date format parsing fails:

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (recentDateFormat != &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
				pp = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ParsePosition(0);
				&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; year = Calendar.getInstance().get(Calendar.YEAR);
				&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; timeStampStrPlusYear = timestampStr + &lt;span class=&quot;code-quote&quot;&gt;&quot; &quot;&lt;/span&gt; + year;
				SimpleDateFormat hackFormatter = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; SimpleDateFormat(recentDateFormat.toPattern() + &lt;span class=&quot;code-quote&quot;&gt;&quot; yyyy&quot;&lt;/span&gt;);
				hackFormatter.setLenient(&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;);
				parsed = hackFormatter.parse(timeStampStrPlusYear, pp);
			}
			&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (parsed != &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; pp.getIndex() == timestampStr.length() + 5) {
				working.setTime(parsed);
			}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Although that is really hacky.&lt;/p&gt;</comment>
                    <comment id="12572551" author="rwinston@eircom.net" created="Tue, 26 Feb 2008 08:40:58 -0800 (PST)"  >Ok....I&apos;ve added a &quot;fix&quot; on the 2.0 dev branch for testing.....does anyone feel brave enough to check it out, build it, and try a test to see if it works on their system?

&lt;p&gt;$ svn checkout &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://svn.apache.org/repos/asf/commons/proper/net/branches/NET_2_0&quot;&gt;http://svn.apache.org/repos/asf/commons/proper/net/branches/NET_2_0&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt; commons-net&lt;/p&gt;</comment>
                    <comment id="12572759" author="manhole" created="Tue, 26 Feb 2008 17:58:05 -0800 (PST)"  >Rory, thank you for the quick follow-up.

&lt;p&gt;In my environment, I got it to work when I also provided DateFormatSymbols to the constructor to make sure the formatting is done in the same locale.&lt;br/&gt;
Also, I think setting the TimeZone is necessary. Please let me know your thoughts.&lt;/p&gt;

&lt;p&gt;Please see below for proposed changes:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Index: FTPTimestampParserImpl.java
===================================================================
--- FTPTimestampParserImpl.java	(revision 631446)
+++ FTPTimestampParserImpl.java	(working copy)
@@ -104,8 +104,9 @@
 				pp = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ParsePosition(0);
 				&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; year = Calendar.getInstance().get(Calendar.YEAR);
 				&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; timeStampStrPlusYear = timestampStr + &lt;span class=&quot;code-quote&quot;&gt;&quot; &quot;&lt;/span&gt; + year;
-				SimpleDateFormat hackFormatter = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; SimpleDateFormat(recentDateFormat.toPattern() + &lt;span class=&quot;code-quote&quot;&gt;&quot; yyyy&quot;&lt;/span&gt;);
+				SimpleDateFormat hackFormatter = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; SimpleDateFormat(recentDateFormat.toPattern() + &lt;span class=&quot;code-quote&quot;&gt;&quot; yyyy&quot;&lt;/span&gt;, recentDateFormat.getDateFormatSymbols());
 				hackFormatter.setLenient(&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;);
+				hackFormatter.setTimeZone(recentDateFormat.getTimeZone());
 				parsed = hackFormatter.parse(timeStampStrPlusYear, pp);
 			}
 			&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (parsed != &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; pp.getIndex() == timestampStr.length() + 5) {&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="12573709" author="willwright" created="Fri, 29 Feb 2008 04:37:39 -0800 (PST)"  >Thanks HONMA - came across this when our production system refused to retrieve any files for today. This fix works a treat.</comment>
                    <comment id="12573745" author="timfooy" created="Fri, 29 Feb 2008 06:00:21 -0800 (PST)"  >A combination of this issue and this one &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://issues.apache.org/bugzilla/show_bug.cgi?id=41724&quot;&gt;https://issues.apache.org/bugzilla/show_bug.cgi?id=41724&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;  has caused a lot of problems in our production environment.  Too bad that the ANT team seems to have fixed this half a year ago but have not released anything since then.  (See &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java?r1=526548&amp;amp;r2=574313&amp;amp;diff_format=h&quot;&gt;http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java?r1=526548&amp;amp;r2=574313&amp;amp;diff_format=h&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt; )&lt;br/&gt;
I hope these fixes in both projects will soon reach a release.</comment>
                    <comment id="12573746" author="cybertiger" created="Fri, 29 Feb 2008 06:01:16 -0800 (PST)"  >I&apos;m not in a position to ship the a 3rd party library from subversion as part of our companies product, and this bug is critical for me.

&lt;p&gt;I need a  workaround for this, unfortunately my attempts are getting more and more hacky, my original attempt involved using the deprecated API to create my own subclass of UnixFTPEntryParser, and then I overrode parseTimestamp() to simply return null as for my purposes I do not need the timestamp.&lt;/p&gt;

&lt;p&gt;Unfortunately the code in UnixFTPEntryParser.parseFTPEntry(...) calls super.parseTimestamp(...) which makes this approach fail.&lt;/p&gt;

&lt;p&gt;I&apos;m also quite perturbed that the API to plug in your own parser has been deprecated and no alternative method to provide your own parser has been implemented, it&apos;s naive to say the least to assume that the commons-net implementation will support all possible list formats in existence.&lt;/p&gt;</comment>
                    <comment id="12573755" author="ndv" created="Fri, 29 Feb 2008 06:13:48 -0800 (PST)"  >I&apos;ve figured out the the real problem is setLenient (false). A lenient SDF parses Feb 29 correctly. I wonder if is there any reason to use non-lenient SDF? What if just remove setLenient(false)?</comment>
                    <comment id="12573810" author="bonefish" created="Fri, 29 Feb 2008 08:10:21 -0800 (PST)"  >Attachted is a somewhat crude but effective work-around: &quot;Feb 29&quot; is replaced by &quot;Feb 28&quot; and after parsing the day is incremented.</comment>
                    <comment id="12573817" author="tsnyder" created="Fri, 29 Feb 2008 08:29:42 -0800 (PST)"  >Please consider the following.  

&lt;p&gt;1. This bug is not specific to leap year.  This will also occur if a file has a timestamp for the non-existent hour during a DST switch.  &lt;br/&gt;
In the U.S. On March 9, 2008 I expect all files created between 2:00am and 2:59am to have a similar issue.&lt;/p&gt;

&lt;p&gt;2. If you setLenient(True), Feb 29 will be returned as March 1.  The current implementation will then see March 1 (on Feb 29th) as the previous year.&lt;/p&gt;
</comment>
                    <comment id="12573879" author="bpphillips" created="Fri, 29 Feb 2008 10:27:06 -0800 (PST)"  >&amp;gt; On March 9, 2008 I expect all files created between 2:00am and 2:59am to have a similar issue.

&lt;p&gt;Actually, these timestamps won&apos;t have a problem since they existed in 1970.  However, trying to parse &quot;Apr 26 02:01&quot; with SimpleDateFormat (using format &quot;MMM d HH:mm&quot;) in non-lenient mode does in fact result in the same ParseException being thrown since that was the DST cutover in 1970.&lt;/p&gt;</comment>
                    <comment id="12574043" author="carej@us.ibm.com" created="Fri, 29 Feb 2008 17:07:25 -0800 (PST)"  >Is there any way to force the FTP server to always use the long timestamp format?</comment>
                    <comment id="12574098" author="rwinston@eircom.net" created="Sat, 1 Mar 2008 04:14:36 -0800 (PST)"  >Guys

&lt;p&gt;Thanks for all the comments and suggestions. I think that I may go for a combination of my suggested fix, Honma&apos;s enhancements, and a GregorianCalendar::isLeapYear() check that somebody else suggested.&lt;/p&gt;

&lt;p&gt;In regards to the question about setLenient(), its actually important that we use strict parsing, otherwise dates that the date parser regards as invalid may be rolled over to the nearest valid date, which we don&apos;t want.&lt;/p&gt;

&lt;p&gt;I&apos;ll check out the scenario that Terrance has raised before committing a final fix.&lt;/p&gt;</comment>
                    <comment id="12574107" author="rwinston@eircom.net" created="Sat, 1 Mar 2008 04:39:07 -0800 (PST)"  >I cant reproduce the problem with Apr 26 02:01 - parses fine for me. 

&lt;p&gt;I&apos;ll add the isLeapYear() check, as I think the only instance where this is a problem is on a leap year day.&lt;/p&gt;</comment>
                    <comment id="12574116" author="sebb@apache.org" created="Sat, 1 Mar 2008 06:46:20 -0800 (PST)"  >Seems to me that a lot of the problems have arisen because the array item that is returned for invalid dates is null.

&lt;p&gt;This might possibly still happen in some cases, so may I suggest that the code at least returns a valid entry?&lt;br/&gt;
If necessary set the file date to the Java epoch, and document this as a possible return.&lt;/p&gt;

&lt;p&gt;At least then the file name and most attributes would be available.&lt;/p&gt;</comment>
                    <comment id="12574486" author="bpphillips" created="Mon, 3 Mar 2008 04:48:22 -0800 (PST)"  >The attached JUnit test case shows that this problem will reoccur on any date/time that doesn&apos;t exist in the default year 1970.  Specifically, April 26 at 2am (the time at which DST was put into affect in 1970) is unparseable by SimpleDateFormat:

&lt;p&gt;java.text.ParseException: Unparseable date: &quot;Apr 26 02:00&quot;&lt;br/&gt;
	at java.text.DateFormat.parse(DateFormat.java:337)&lt;br/&gt;
	at DstParseTest.testParseDstWithNoYear(DstParseTest.java:21)&lt;br/&gt;
        &lt;span class=&quot;error&quot;&gt;&amp;#91;snip&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;This issue may be specific to the default timezone of your system so the test case explicitly calls sets the time zone to &quot;US/Central&quot; which is my default and exhibits the ParseException failure.&lt;/p&gt;</comment>
                    <comment id="12574559" author="bodik" created="Mon, 3 Mar 2008 07:32:05 -0800 (PST)"  >It looks like the bug occurs only under jdk 1.5 and above.&lt;br/&gt;
It does not appeir under jdk 1.3.1 and 1.4.2.&lt;br/&gt;
I tested it with SUN jdk.</comment>
                    <comment id="12574870" author="skaffman" created="Mon, 3 Mar 2008 23:51:39 -0800 (PST)"  >The fix will be released as 1.4.2, I hope, not just added to the 2.0 trunk?</comment>
                    <comment id="12575065" author="rwinston@eircom.net" created="Tue, 4 Mar 2008 09:26:59 -0800 (PST)"  >I have added the fix on both the 1.5.0 and 2.0 branches. I have also removed the specific leap year check, as Brian&apos;s test case shows that other parsing ambiguities can occur.</comment>
                    <comment id="12575130" author="sebb@apache.org" created="Tue, 4 Mar 2008 12:48:43 -0800 (PST)"  >Add test cases for Feb 29 in leap and non-leap years</comment>
                    <comment id="12576525" author="sebb@apache.org" created="Sat, 8 Mar 2008 02:22:31 -0800 (PST)"  >Current code (FTPTimestampParserImpl r633380) does not work.

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;        FTPTimestampParserImpl parser = new FTPTimestampParserImpl();&lt;br/&gt;
        DateFormat df = SimpleDateFormat.getDateTimeInstance();&lt;br/&gt;
        Calendar cal;&lt;br/&gt;
        cal=parser.parseTimestamp(&quot;feb 29 20:04&quot;);&lt;br/&gt;
        System.out.println(df.format(cal.getTime()));&lt;/p&gt;

&lt;p&gt;generates&lt;/p&gt;

&lt;p&gt;       01-Mar-2008 20:04:00&lt;/p&gt;

&lt;p&gt;I think the code needs to add the year (current or +/- 1 year) to the string to be parsed.&lt;br/&gt;
I hope to provide a patch this weekend.&lt;/p&gt;</comment>
                    <comment id="12576527" author="rwinston@eircom.net" created="Sat, 8 Mar 2008 03:09:36 -0800 (PST)"  >Hi Sebb

&lt;p&gt;This works fine for me on net-1.5 and net-2.0. Can you step into the code and make sure that it is hitting the point where it adds the year element (which it should be doing already)?&lt;/p&gt;</comment>
                    <comment id="12576538" author="sebb@apache.org" created="Sat, 8 Mar 2008 05:23:08 -0800 (PST)"  >Just found that the test works on Java 1.5 but fails with Java 1.4 (and probably 1.3)&lt;br/&gt;
Presumably something has changed in the Java 1.5 run-time library.

&lt;p&gt;Since net 1.5 is targetted at Java 1.3 the problem needs to be fixed.&lt;/p&gt;

&lt;p&gt;There also clearly need to be test cases for Feb 29.&lt;br/&gt;
I think full testing depends on &lt;a href=&quot;http://issues.apache.org/jira/browse/NET-198&quot; title=&quot;FTPTimestampParserImpl#parseTimeStamp() is not fully testable&quot;&gt;&lt;del&gt;NET-198&lt;/del&gt;&lt;/a&gt; being applied, but one can run the following Feb 29 test at present:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; void testParseFeb29() &lt;span class=&quot;code-keyword&quot;&gt;throws&lt;/span&gt; Exception {
        FTPTimestampParserImpl parser = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; FTPTimestampParserImpl();
        Calendar cal;
        cal=parser.parseTimestamp(&lt;span class=&quot;code-quote&quot;&gt;&quot;feb 29 20:04&quot;&lt;/span&gt;);
        &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; dom = cal.get(Calendar.DAY_OF_MONTH);
        &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; mon = cal.get(Calendar.MONTH);
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (dom != 29 || mon != Calendar.FEBRUARY){
            mon++;
            fail(&lt;span class=&quot;code-quote&quot;&gt;&quot;failed to parse Feb 29; gave mon=&quot;&lt;/span&gt;+mon+&lt;span class=&quot;code-quote&quot;&gt;&quot; dom=&quot;&lt;/span&gt;+dom);
        }
    }&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="12576830" author="sebb@apache.org" created="Sun, 9 Mar 2008 15:43:53 -0700 (PDT)"  >This is related to &lt;a href=&quot;http://issues.apache.org/jira/browse/NET-83&quot; title=&quot;[net] FTP timestamp: year recognition&quot;&gt;&lt;del&gt;NET-83&lt;/del&gt;&lt;/a&gt;, which describes another instance where the FTP directory listing does not show the year.&lt;br/&gt;
Note that FreeBSD shows past and future dates without the year if the date is within 6 months of the current date, for example:

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;-rw-r--r--  1 user Domain Users  0 Sep  9  2007 200709091234.tmp
-rw-r--r--  1 user Domain Users  0 Sep 10 12:34 200709101234.tmp

-rw-r--r--  1 user Domain Users  0 Sep  7 12:34 200809071234.tmp
-rw-r--r--  1 user Domain Users  0 Sep  8  2008 200809081234.tmp

Sun Mar  9 15:05:09 EDT 2008 # date when listing was obtained&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The file names show the actual timestamp used to &quot;touch&quot; the files.&lt;/p&gt;

&lt;p&gt;Looks like the interval that is used is 26 weeks.&lt;br/&gt;
Provided that the client and server clocks are not adrift by more than a day, this should mean that a short date is never ambiguous.&lt;/p&gt;</comment>
                    <comment id="12578008" author="sebb@apache.org" created="Wed, 12 Mar 2008 13:19:42 -0700 (PDT)"  >Patch which appears to solve the Feb 29 problem on Java 1.4.&lt;br/&gt;
Can also be applied to NET_2.0 branch if desired.&lt;br/&gt;
The patch changes the processing so the short form is always parsed with the current year appended.&lt;br/&gt;
So the short form format string(s) could potentially be changed to include the year.</comment>
                    <comment id="12579187" author="moberhuber" created="Sun, 16 Mar 2008 05:53:08 -0700 (PDT)"  >I applied the patch, and it works fine for Feb.29.

&lt;p&gt;But I see a problem when it is Dec.31 on the client computer, server is in a different time zone and shows a date as Jan.01 &amp;#8211; in this case the result date is rolled back a whole year. Here is a test case, that can be added to FTPTimestampParserImplTest.java, and fails with both Commons.Net 1.4.1 as well as HEAD as well as with the patch applied:&lt;/p&gt;

&lt;p&gt;    public void testParseJan01() throws Exception {
        GregorianCalendar now = new GregorianCalendar(2007, Calendar.DECEMBER, 31, 12, 0);
        checkShortParse(&quot;2007-12-31&quot;,now,now); // should always work
        GregorianCalendar target = (GregorianCalendar) now.clone();
        target.add(Calendar.DAY_OF_YEAR, +1);
        checkShortParse(&quot;2008-1-1&quot;,now,target);
    }&lt;/p&gt;


&lt;p&gt;I think this is the kind of situation that was originally meant to address with the setLenienFutureDates() method - See &lt;a href=&quot;http://issues.apache.org/jira/browse/NET-83&quot; title=&quot;[net] FTP timestamp: year recognition&quot;&gt;&lt;del&gt;NET-83&lt;/del&gt;&lt;/a&gt;, comment on FTPTimestampParserImpl is &quot;Fix bug 35181 - add an option to specify leniency when needed because client and server systems cannot be synchronized.&quot;&lt;/p&gt;

&lt;p&gt;The right solution, IMHO, is to allow short dates +- 6 months in the future or past, which seems to be in line with what FreeBSD is doing as well as what Linux is doing. Note that allowing a short date in the future might require adding &quot;current year + 1&quot; to the current Feb29 hack to fix a case where a future date is a leap year on Feb.29.&lt;/p&gt;</comment>
                    <comment id="12579188" author="moberhuber" created="Sun, 16 Mar 2008 05:56:56 -0700 (PDT)"  >Patch to add testcase for Jan01 to FTPTimestampParserImplTest.java

&lt;p&gt;Sorry for not knowing how to format the testcase properly in a Jira comment.&lt;/p&gt;</comment>
                    <comment id="12579247" author="rwinston@eircom.net" created="Sun, 16 Mar 2008 13:21:39 -0700 (PDT)"  >Ok, so if we add the +/- 6 month date parsing logic, do you think we should make this the default? Or an optional operating mode (like the current lenient mode)? Or could we just drop the lenient mode if we add the +/- 6 month parsing?</comment>
                    <comment id="12579253" author="moberhuber" created="Sun, 16 Mar 2008 13:52:00 -0700 (PDT)"  >I&apos;d suggest that in terms of API, when a programmer knows the exact behavior of the server, he should be able to get exact timestamps even if they are short and/or in the future. Right now we know that FreeBSD does +-6-month short dates; Linux RHEL4 does +0/-6-month short dates.

&lt;p&gt;So what about a new API like&lt;br/&gt;
&amp;lt;code&amp;gt;&lt;br/&gt;
   FTPClientConfig#setShortDateRange(long msecPast, long msecFuture)&lt;br/&gt;
&amp;lt;/code&amp;gt;&lt;br/&gt;
that specifies in what range of time difference a short date is considered to be in the past, or in the future respectively. The Javadoc comment could be similar to the #setLenientFutureDates() method.&lt;/p&gt;

&lt;p&gt;The old setLenientFutureDates(boolean) method could be deprecated, and translated into this:&lt;br/&gt;
&amp;lt;code&amp;gt;&lt;br/&gt;
if(lenientFutureDates) {
   setShortDateRange(1000L * 86400 * 364, 1000L * 86400);
} else {
   setShortDateRange(1000L * 86400 * 365, 0);
}&lt;br/&gt;
&amp;lt;/code&amp;gt;&lt;/p&gt;

&lt;p&gt;I&apos;m not completely sure what would be the best default value for the new settings. Given that lenientFutureDates was false by default, we should probably always expect dates in the past only by default. On the other hand, given that a &quot;one day in future&quot; date is much more likely due to time zone differences than a &quot;365 days in the past&quot; short date, a setting of +1 day / -364 days might be a more appropriate default.&lt;/p&gt;

&lt;p&gt;As a matter of fact, we cannot ever guarantee correct parsing when the user has not specified by API what the setting should be. So the goal of a good default setting could either be &quot;avoid invalid dates even if a parse error occurs&quot; (not expected by the average user, IMHO, as the Feb.29 case shows); or, &quot;always fall back to a reasonable date as it would be read by the user, even if it might be incorrect&quot;.&lt;/p&gt;

&lt;p&gt;Given that the original RFC for FTP says &quot;The output of DIR is designed for human readers and might not be machine readable&quot;, I think the default should be guided by what a human user would expect from the listing. That being said, I think that when it&apos;s March 15 and I&apos;m reading &quot;March 16&quot; I&apos;d expect a future date; reading &quot;March 20&quot; I&apos;d expect a past date; so I&apos;m in favor of a &quot;+1 day / -364 days&quot; strategy by default.&lt;/p&gt;

&lt;p&gt;Which is, admittedly, breaking the previous behavior which was lenientFuture == false meanding a +0 / -365 strategy.&lt;/p&gt;</comment>
                    <comment id="12581653" author="mhnagaoka" created="Mon, 24 Mar 2008 12:44:49 -0700 (PDT)"  >Don&apos;t you guys think that the piece of code below:
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (lenientFutureDates) {
 &lt;span class=&quot;code-comment&quot;&gt;// add a day to &lt;span class=&quot;code-quote&quot;&gt;&quot;now&quot;&lt;/span&gt; so that &lt;span class=&quot;code-quote&quot;&gt;&quot;slop&quot;&lt;/span&gt; doesn&apos;t cause a date 
&lt;/span&gt; &lt;span class=&quot;code-comment&quot;&gt;// slightly in the &lt;span class=&quot;code-keyword&quot;&gt;future&lt;/span&gt; to roll back a full year.  (Bug 35181)
&lt;/span&gt; now.add(Calendar.DATE, 1);
}    
&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (working.after(now)) {
 working.add(Calendar.YEAR, -1);
}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; should also be executed when the &lt;tt&gt;hackFormatter&lt;/tt&gt; is used? Rather than only when the &lt;tt&gt;recentDateFormat&lt;/tt&gt; is used?&lt;/p&gt;</comment>
                    <comment id="12586215" author="sebb@apache.org" created="Sun, 6 Apr 2008 17:28:36 -0700 (PDT)"  >Applied patch of 12/Mar/08 01:19 PM to trunk:

&lt;p&gt;&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://svn.apache.org/viewvc?rev=645336&amp;amp;view=rev&quot;&gt;http://svn.apache.org/viewvc?rev=645336&amp;amp;view=rev&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;This fixes the Feb 29 test errors.&lt;/p&gt;

&lt;p&gt;As far as I can see also addresses Mauricio&apos;s comment of 24/Mar/08.&lt;/p&gt;

&lt;p&gt;There remains the problem of future dates.&lt;/p&gt;</comment>
                    <comment id="12586219" author="sebb@apache.org" created="Sun, 6 Apr 2008 18:49:25 -0700 (PDT)"  >I think the original bug (Feb 29 parsing) reported in this issue has now been solved, so this issue can be closed.

&lt;p&gt;I&apos;ve created two new JIRA issues to deal with the other issues raised in the discussion above:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://issues.apache.org/jira/browse/NET-211&quot; title=&quot;setLenient() does not work across a year boundary&quot;&gt;&lt;del&gt;NET-211&lt;/del&gt;&lt;/a&gt; - setLenient() does not work across a year boundary&lt;br/&gt;
&lt;a href=&quot;http://issues.apache.org/jira/browse/NET-212&quot; title=&quot;FTP short date parsing - how to handle future dates&quot;&gt;NET-212&lt;/a&gt; - FTP short date parsing - how to handle future dates &lt;/p&gt;</comment>
                    <comment id="12586394" author="moberhuber" created="Mon, 7 Apr 2008 06:54:12 -0700 (PDT)"  >I&apos;m also fine with closing this. There&apos;s only FTPTimestampParserImpl line 124 which I do not quite understand:

&lt;p&gt;&amp;lt;code&amp;gt;&lt;br/&gt;
working.set(Calendar.YEAR, now.get(Calendar.YEAR));&lt;br/&gt;
&amp;lt;/code&amp;gt;&lt;/p&gt;

&lt;p&gt;This code branch only gets executed when the hackFormatter parsed OK, so it must have read the year already and setting the year yet again should be unnecessary?&lt;/p&gt;</comment>
                    <comment id="12586402" author="sebb@apache.org" created="Mon, 7 Apr 2008 07:11:46 -0700 (PDT)"  >I think you&apos;re correct - looks like that line is a left-over from the previous code, where the hackFormatter parsing was done later.

&lt;p&gt;Fixed in:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://svn.apache.org/viewvc?rev=645528&amp;amp;view=rev&quot;&gt;http://svn.apache.org/viewvc?rev=645528&amp;amp;view=rev&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;</comment>
                    <comment id="12596445" author="sumauan" created="Tue, 13 May 2008 09:58:03 -0700 (PDT)"  >I&apos;ve done another fix for the leap year problem. This should work regardless which is the correct year for the 29. Feb (this year or last year).&lt;br/&gt;
See attached file &quot;FTPTimestampParserImpl.patch&quot;

&lt;p&gt;Index: FTPTimestampParserImpl.java&lt;br/&gt;
===================================================================&lt;br/&gt;
&amp;#8212; FTPTimestampParserImpl.java	(revision 473)&lt;br/&gt;
+++ FTPTimestampParserImpl.java	(working copy)&lt;br/&gt;
@@ -41,6 +41,7 @@&lt;/p&gt;

&lt;p&gt; 	private SimpleDateFormat defaultDateFormat;&lt;br/&gt;
 	private SimpleDateFormat recentDateFormat;&lt;br/&gt;
+	private SimpleDateFormat recentWithYearDateFormat;&lt;/p&gt;


&lt;p&gt; 	/**&lt;br/&gt;
@@ -75,35 +76,62 @@&lt;br/&gt;
 		ParsePosition pp = new ParsePosition(0);&lt;/p&gt;

&lt;p&gt; 		Date parsed = null;&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;if (this.recentDateFormat != null) {
-			parsed = recentDateFormat.parse(timestampStr, pp);
-		}&lt;/li&gt;
	&lt;li&gt;if (parsed != null &amp;amp;&amp;amp; pp.getIndex() == timestampStr.length())&lt;/li&gt;
	&lt;li&gt;{&lt;/li&gt;
	&lt;li&gt;working.setTime(parsed);&lt;/li&gt;
	&lt;li&gt;working.set(Calendar.YEAR, now.get(Calendar.YEAR));&lt;/li&gt;
	&lt;li&gt;if (working.after(now)) {
-				working.add(Calendar.YEAR, -1);
-			}&lt;/li&gt;
	&lt;li&gt;} else {&lt;br/&gt;
+		if (recentWithYearDateFormat != null) {&lt;br/&gt;
+			//For the 29. Feb of a leap year we have to parse with the correct year because&lt;br/&gt;
+			//parsing without a year defaults to 1970 which is not a leap year, then the parsing fails or we get the 1 of mrach&lt;br/&gt;
+			String timestamWithYearStr = timestampStr.trim() + &quot; &quot; + now.get(Calendar.YEAR);&lt;br/&gt;
 			pp = new ParsePosition(0);&lt;/li&gt;
	&lt;li&gt;parsed = defaultDateFormat.parse(timestampStr, pp);&lt;/li&gt;
	&lt;li&gt;// note, length checks are mandatory for us since&lt;/li&gt;
	&lt;li&gt;// SimpleDateFormat methods will succeed if less than&lt;/li&gt;
	&lt;li&gt;// full string is matched.  They will also accept,&lt;/li&gt;
	&lt;li&gt;// despite &quot;leniency&quot; setting, a two-digit number as&lt;/li&gt;
	&lt;li&gt;// a valid year (e.g. 22:04 will parse as 22 A.D.)&lt;/li&gt;
	&lt;li&gt;// so could mistakenly confuse an hour with a year,&lt;/li&gt;
	&lt;li&gt;// if we don&apos;t insist on full length parsing.&lt;/li&gt;
	&lt;li&gt;if (parsed != null &amp;amp;&amp;amp; pp.getIndex() == timestampStr.length()) {&lt;br/&gt;
+			parsed = recentWithYearDateFormat.parse(timestamWithYearStr, pp);&lt;br/&gt;
+			if (parsed != null &amp;amp;&amp;amp; pp.getIndex() == timestamWithYearStr.length()) &lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unknown macro: { 				working.setTime(parsed);+				working.set(Calendar.YEAR, now.get(Calendar.YEAR));+				if (working.after(now)) {
+					working.add(Calendar.YEAR, -1);
+				}&lt;br/&gt;
+				&lt;br/&gt;
+				return working;&lt;br/&gt;
 			} else {&lt;br/&gt;
-				throw new ParseException(&lt;br/&gt;
-					&quot;Timestamp could not be parsed with older or recent DateFormat&quot;, &lt;br/&gt;
-					pp.getIndex());&lt;br/&gt;
+				timestamWithYearStr = timestampStr.trim() + &quot; &quot; + (now.get(Calendar.YEAR) - 1);&lt;br/&gt;
+				pp = new ParsePosition(0);&lt;br/&gt;
+				parsed = recentWithYearDateFormat.parse(timestamWithYearStr, pp);&lt;br/&gt;
+				if (parsed != null &amp;amp;&amp;amp; pp.getIndex() == timestamWithYearStr.length()) {
+					working.setTime(parsed);
+					return working;
+				}&lt;br/&gt;
 			}&lt;br/&gt;
+		} else if (this.recentDateFormat != null) {&lt;br/&gt;
+			parsed = recentDateFormat.parse(timestampStr, pp);&lt;br/&gt;
+			if (parsed != null &amp;amp;&amp;amp; pp.getIndex() == timestampStr.length()) &lt;br/&gt;
+			{&lt;br/&gt;
+				working.setTime(parsed);&lt;br/&gt;
+				working.set(Calendar.YEAR, now.get(Calendar.YEAR));&lt;br/&gt;
+				if (working.after(now)) {
+					working.add(Calendar.YEAR, -1);
+				}	}&lt;/span&gt; &lt;/div&gt;&lt;br/&gt;
+				&lt;br/&gt;
+				return working;&lt;br/&gt;
+			}&lt;br/&gt;
 		}&lt;/li&gt;
	&lt;li&gt;return working;&lt;br/&gt;
+		&lt;br/&gt;
+		pp = new ParsePosition(0);&lt;br/&gt;
+		parsed = defaultDateFormat.parse(timestampStr, pp);&lt;br/&gt;
+		// note, length checks are mandatory for us since&lt;br/&gt;
+		// SimpleDateFormat methods will succeed if less than&lt;br/&gt;
+		// full string is matched.  They will also accept, &lt;br/&gt;
+		// despite &quot;leniency&quot; setting, a two-digit number as&lt;br/&gt;
+		// a valid year (e.g. 22:04 will parse as 22 A.D.) &lt;br/&gt;
+		// so could mistakenly confuse an hour with a year, &lt;br/&gt;
+		// if we don&apos;t insist on full length parsing.&lt;br/&gt;
+		if (parsed != null &amp;amp;&amp;amp; pp.getIndex() == timestampStr.length()) {
+			working.setTime(parsed);
+			
+			return working;
+		}&lt;br/&gt;
+			&lt;br/&gt;
+&lt;br/&gt;
+		throw new ParseException(&lt;br/&gt;
+				&quot;Timestamp could not be parsed with older or recent DateFormat&quot;, &lt;br/&gt;
+				pp.getIndex());&lt;br/&gt;
 	}&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt; 	/**&lt;br/&gt;
@@ -146,6 +174,11 @@&lt;br/&gt;
 		if (format != null) {&lt;br/&gt;
 			this.recentDateFormat = new SimpleDateFormat(format);&lt;br/&gt;
 			this.recentDateFormat.setLenient(false);&lt;br/&gt;
+			&lt;br/&gt;
+			if (format.indexOf(&quot;y&quot;) == -1) {
+				this.recentWithYearDateFormat = new SimpleDateFormat(format.trim() + &quot; yyyy&quot;);
+				this.recentWithYearDateFormat.setLenient(false);
+			}&lt;br/&gt;
 		}&lt;br/&gt;
 	}&lt;/p&gt;

&lt;p&gt;@@ -179,6 +212,9 @@&lt;br/&gt;
 		if (this.recentDateFormat != null) {
 			this.recentDateFormat.setTimeZone(serverTimeZone);
 		}			&lt;br/&gt;
+		if (this.recentWithYearDateFormat != null) {
+			this.recentWithYearDateFormat.setTimeZone(serverTimeZone);
+		}			&lt;br/&gt;
 	}&lt;/p&gt;

&lt;p&gt; 	/**&lt;br/&gt;
@@ -223,6 +259,11 @@&lt;br/&gt;
 		} else {&lt;br/&gt;
 			this.recentDateFormat = new SimpleDateFormat(recentFormatString, dfs);&lt;br/&gt;
 			this.recentDateFormat.setLenient(false);&lt;br/&gt;
+&lt;br/&gt;
+			if (recentFormatString.indexOf(&quot;y&quot;) == -1) {
+				this.recentWithYearDateFormat = new SimpleDateFormat(recentFormatString.trim() + &quot; yyyy&quot;, dfs);
+				this.recentWithYearDateFormat.setLenient(false);
+			}&lt;br/&gt;
 		}&lt;/p&gt;

&lt;p&gt; 		String defaultFormatString = config.getDefaultDateFormatStr();&lt;/p&gt;
</comment>
                    <comment id="12596452" author="sebb@apache.org" created="Tue, 13 May 2008 10:07:41 -0700 (PDT)"  >Thanks, but it has already been fixed in SVN.</comment>
                    <comment id="12597281" author="antonio" created="Thu, 15 May 2008 14:43:17 -0700 (PDT)"  >If this is fixed, you should close this issue. &lt;img class=&quot;emoticon&quot; src=&quot;https://issues.apache.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;</comment>
                </comments>
    
    <issuelinks>
                <issuelinktype id="10032">
            <name>Blocker</name>
                                        <inwardlinks description="is blocked by">
                            <issuelink>
            <issuekey id="12390526">NET-198</issuekey>
        </issuelink>
                    </inwardlinks>
                    </issuelinktype>
                <issuelinktype id="12310000">
            <name>Duplicate</name>
                                        <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="12399076">NET-224</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="12392695">NET-209</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="12390542">NET-199</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="12390098">NET-193</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="12389869">NET-190</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="12389928">NET-191</issuekey>
        </issuelink>
                    </inwardlinks>
                    </issuelinktype>
                <issuelinktype id="10030">
            <name>Reference</name>
                            <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="12389871">VFS-201</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="12393276">NET-211</issuekey>
        </issuelink>
                    </outwardlinks>
                                        <inwardlinks description="is related to">
                            <issuelink>
            <issuekey id="12393277">NET-212</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="12342278">NET-83</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="12391514">NET-205</issuekey>
        </issuelink>
                    </inwardlinks>
                    </issuelinktype>
            </issuelinks>
    <attachments>
            <attachment id="12376838" name="commons-net-ftp-date-parser-feb29.patch" size="1255" author="bonefish" created="Fri, 29 Feb 2008 08:10:21 -0800 (PST)" />
            <attachment id="12376974" name="DstParseTest.java" size="545" author="bpphillips" created="Mon, 3 Mar 2008 04:48:22 -0800 (PST)" />
            <attachment id="12381969" name="FTPTimestampParserImpl.patch" size="4665" author="sumauan" created="Tue, 13 May 2008 09:58:03 -0700 (PDT)" />
            <attachment id="12377727" name="FTPTimestampParserLeap.patch" size="4473" author="sebb@apache.org" created="Wed, 12 Mar 2008 13:19:42 -0700 (PDT)" />
            <attachment id="12377995" name="jan01.patch" size="677" author="moberhuber" created="Sun, 16 Mar 2008 05:56:56 -0700 (PDT)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-184] FtpClient.listFiles truncates directory name beginning with a number</title>
<link>http://issues.apache.org/jira/browse/NET-184</link>

                    <description>I used FtpClient.listFiles() to get a listing of all files in the current working directory on a remote Windows server.  If a remote directory begins with a number followed by a space and more text (e.g., 2008 Rates) the name returned by FTPFile.getName() has the leading number truncated (so &apos;2008 Rates&apos; would be &apos;Rates&apos;).  Examining the value returned by FTPFile.toString() or getRawListing() both show the full file name, but the name returned by getName() is truncated.

&lt;p&gt;If the directory begins with a number and is not followed by a space (e.g., 2008_Rates) the correct name is returned by getName().  If there is a number after the test (like&apos;Rates for 2008&apos;) the correct name is returned by getName().&lt;/p&gt;

&lt;p&gt;Files do not appear to be affected by this.  The getName() function returns the correct name regardless of  the position of a number or the white space aorund it.&lt;/p&gt;
</description>
                <environment>Local is Unix (AIX), remote is Windows </environment>
            <key id="12388707">NET-184</key>
        <summary>FtpClient.listFiles truncates directory name beginning with a number</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="ironstar">Tom Caruso</reporter>
            
    <created>Thu, 14 Feb 2008 11:59:40 -0800 (PST)</created>
    <updated>Tue, 19 Feb 2008 13:30:19 -0800 (PST)</updated>

                        <version>1.4</version>
            
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12570456" author="rwinston@eircom.net" created="Tue, 19 Feb 2008 13:30:19 -0800 (PST)"  >This has been fixed in 2.0. </comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-182] NPE in DefaultFTPFileEntryParserFactory</title>
<link>http://issues.apache.org/jira/browse/NET-182</link>

                    <description>createFileEntryParser needs to null protect from a null &apos;key&apos; parameter.</description>
                <environment>Fortify</environment>
            <key id="12386462">NET-182</key>
        <summary>NPE in DefaultFTPFileEntryParserFactory</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="bayard">Henri Yandell</reporter>
            
    <created>Wed, 16 Jan 2008 23:01:46 -0800 (PST)</created>
    <updated>Sun, 17 Feb 2008 16:22:37 -0800 (PST)</updated>

                
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-179] NET-73    &quot;TelnetInputStream._read() hangs&quot; fix is not included in nightly builds.</title>
<link>http://issues.apache.org/jira/browse/NET-179</link>

                    <description>The fix for  &quot;TelnetInputStream._read()  hangs&quot;  was not included in nightly builds.May i know the exact solution for this problem.</description>
                <environment></environment>
            <key id="12385237">NET-179</key>
        <summary>NET-73    &quot;TelnetInputStream._read() hangs&quot; fix is not included in nightly builds.</summary>
        <type id="3" iconUrl="http://issues.apache.org/jira/images/icons/task.gif">Task</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="chandu603">chandrasekhar reddy</reporter>
            
    <created>Thu, 27 Dec 2007 00:50:59 -0800 (PST)</created>
    <updated>Tue, 19 Feb 2008 14:35:51 -0800 (PST)</updated>

                        <version>1.4</version>
            
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-178] Support for unciode character is missing</title>
<link>http://issues.apache.org/jira/browse/NET-178</link>

                    <description>I&apos;m using sendMessageData() method of SMTPClient class to obtain a Writer object. The mails i need to send contain unicode characters. The Writer which sendMessageData() method returns, uses &quot;ISO-8859-1&quot; encoding which does not provide support for all unicode characters. Also the encoding is not configurable i.e. there is no method through which i can set the encoding to something else. This issue has delayed the release of my project. I think this is a very major issue which needs to be addressed as soon as possible. Unicode support should be provided by this API or encoding must be made configurable. Please provide me a workaround for this issue. It&apos;s very urgent!</description>
                <environment></environment>
            <key id="12385060">NET-178</key>
        <summary>Support for unciode character is missing</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="vibhuti">vibhuti gupta</reporter>
            
    <created>Thu, 20 Dec 2007 20:07:27 -0800 (PST)</created>
    <updated>Thu, 21 Feb 2008 04:03:32 -0800 (PST)</updated>

                        <version>1.4</version>
            
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12570769" author="vibhuti" created="Wed, 20 Feb 2008 09:36:26 -0800 (PST)"  >Encoding has been made configurable in SMTP.java as a fix for this bug. For this constructor which takes encoding as argument is also defined in SMTP.java. The same should be done for all the subclasses of SMTP.java such as SMTPClient.java. I&apos;m using sendMessageData() of SMTPClient class and there is no way to define encoding using this class. It will be highly appreciable if there is jar file which contains these fixes so that i can use it in my project. I mean this fix is released as some separate version.</comment>
                    <comment id="12571025" author="rwinston@eircom.net" created="Thu, 21 Feb 2008 04:03:32 -0800 (PST)"  >I&apos;ve added an overloaded constructor to SMTPClient</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-174] if 150 Here comes directory listing comes before 200, then FTPClient throws exception</title>
<link>http://issues.apache.org/jira/browse/NET-174</link>

                    <description>1. On a FTPClient.listNames(dir), if the 150 Here comes the directory listing, comes before 200 Directory Send Ok, then org.apache.commons.net.ftp.FTP throws exception: &lt;br/&gt;
Could not parse response code. Server Reply: comes the directory listing.

&lt;p&gt;2. Also there seems to be no way to set verbose off.&lt;/p&gt;

&lt;p&gt;May I know how to resolve the above? Please pardon me if I am missing something here. &lt;/p&gt;</description>
                <environment>unix, solaris</environment>
            <key id="12382064">NET-174</key>
        <summary>if 150 Here comes directory listing comes before 200, then FTPClient throws exception</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="deepa2007">Deepa</reporter>
            
    <created>Wed, 7 Nov 2007 17:47:48 -0800 (PST)</created>
    <updated>Tue, 26 Feb 2008 02:48:20 -0800 (PST)</updated>

                
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12571028" author="rwinston@eircom.net" created="Thu, 21 Feb 2008 04:16:34 -0800 (PST)"  >I think the error in this case is exactly the same issue as we are seeing in another issue, where we need to be able to turn on a more lenient response parsing mechanism when required.</comment>
                    <comment id="12572409" author="rwinston@eircom.net" created="Tue, 26 Feb 2008 02:48:20 -0800 (PST)"  >As per the related bug, try setting isStrictMultilineParsing(true) on the FTP client.</comment>
                </comments>
    
    <issuelinks>
                <issuelinktype id="12310020">
            <name>Dependants</name>
                            <outwardlinks description="depends on">
                            <issuelink>
            <issuekey id="12359831">NET-148</issuekey>
        </issuelink>
                    </outwardlinks>
                                </issuelinktype>
            </issuelinks>
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-171] Improve MVSFTPEntryParser.java</title>
<link>http://issues.apache.org/jira/browse/NET-171</link>

                    <description>Hi there,

&lt;p&gt;the &quot;MVSFTPEntryParser&quot; who parses the output of an FTP LIST of an MVS FTP server, is a sad view... it&apos;s totally broken. I developed a custom FTPEntryParser, which I can hook into the FtpClient (thank you for the highly customizable design). I&apos;d like to donate it to COMMONS NET... who can I turn to?&lt;/p&gt;


&lt;p&gt;CU&lt;/p&gt;

&lt;p&gt;Arno Unkrig&lt;/p&gt;</description>
                <environment>MVS FTP server</environment>
            <key id="12379696">NET-171</key>
        <summary>Improve MVSFTPEntryParser.java</summary>
        <type id="4" iconUrl="http://issues.apache.org/jira/images/icons/improvement.gif">Improvement</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="aunkrig">Arno Unkrig</reporter>
            
    <created>Thu, 4 Oct 2007 11:34:39 -0700 (PDT)</created>
    <updated>Sun, 17 Feb 2008 16:19:43 -0800 (PST)</updated>

                
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12533204" author="rwinston@eircom.net" created="Mon, 8 Oct 2007 14:41:25 -0700 (PDT)"  >If you have code you feel is worth contributing, attach it to this issue and I will review it.</comment>
                    <comment id="12533462" author="aunkrig" created="Tue, 9 Oct 2007 12:24:44 -0700 (PDT)"  >Your wish is my command &lt;img class=&quot;emoticon&quot; src=&quot;https://issues.apache.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;

&lt;p&gt;&quot;\MVSFTP\MvsFTPUtil&quot; is the entry point.&lt;/p&gt;


&lt;p&gt;CU&lt;/p&gt;

&lt;p&gt;Arno&lt;/p&gt;</comment>
                    <comment id="12533627" author="aunkrig" created="Tue, 9 Oct 2007 23:44:24 -0700 (PDT)"  >Also, I&apos;d strongly recommend that FTPFile declare an (abstract?) method

&lt;p&gt;    public String getModificationStamp()&lt;/p&gt;

&lt;p&gt;, which returns a short string which is guaranteed to remain the same as long as the file is unmodified and is very probable to change if the file is modified. E.g. on a UNIX system, the modification stamp could be modification time plus file size; on MVS, it could be modification date plus modification level.&lt;/p&gt;

&lt;p&gt;That would be a portable way to detect file changes on the FTP server.&lt;/p&gt;


&lt;p&gt;CU&lt;/p&gt;

&lt;p&gt;Arno&lt;/p&gt;</comment>
                    <comment id="12539830" author="henrik" created="Fri, 2 Nov 2007 22:42:21 -0700 (PDT)"  >where is it broken ?&lt;br/&gt;
Which version of commons.net are you using.&lt;br/&gt;
Henrik
</comment>
                    <comment id="12541466" author="aunkrig" created="Fri, 9 Nov 2007 14:35:47 -0800 (PST)"  >The current implementation does not strip the &quot;title line&quot;, and it does not parse the entries correctly. Also, the MVS FTP server produces (at least) two totally different directory listings, depending on which directory list.

&lt;p&gt;I&apos;m using commons-net-1.4.1.jar, which requires jakarta-oro-2.0.8.jar.&lt;/p&gt;


&lt;p&gt;CU&lt;/p&gt;

&lt;p&gt;Arno&lt;/p&gt;</comment>
                    <comment id="12541641" author="rwinston@eircom.net" created="Sun, 11 Nov 2007 08:03:53 -0800 (PST)"  >Arno

&lt;p&gt;Are you aware of the improvements to the MVS parser that Henrik has applied for the 2.0 release?&lt;/p&gt;

&lt;p&gt;See this thread:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://issues.apache.org/jira/browse/NET-99&quot;&gt;https://issues.apache.org/jira/browse/NET-99&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Is there much overlap between your patches and Henrik&apos;s?&lt;/p&gt;
</comment>
                    <comment id="12542220" author="aunkrig" created="Tue, 13 Nov 2007 12:14:25 -0800 (PST)"  >Hi Rory and Henrik,

&lt;p&gt;I was not aware of Henrik&apos;s MVS improvements for 2.0. Indeed they are exactly what I need! (Hence the overlap is total &lt;img class=&quot;emoticon&quot; src=&quot;https://issues.apache.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; Actually, Henrik&apos;s implementation is much more complete since his understanding of the MVS file system mess is much more complete than mine. I more or less hacked the MVS FTP server behavior.&lt;/p&gt;

&lt;p&gt;Henrik surely agrees that the 1.4.1 MVS parser is totally broken.&lt;/p&gt;

&lt;p&gt;The only point where the solution that Henrik and Steve developed seems a bit too complicated is that they define SEVERAL parsers for the several listing formats of the MVS server, and a strategy to choose one of those. In contrast, I provide only ONE parser class that detects and parses ALL possible MVS listings. In other words: It is arguable whether the N listing formats should be parsed by N parser classes, or if the listing formats produced by the ONE server system MVS should be parsed by ONE parser class. But I&apos;m not the net.commons expert, and I&apos;d be happy to replace my home-grown MVS solution with the net.commons 2.0.&lt;/p&gt;

&lt;p&gt;When will 2.0 be released? I cannot find a roadmap or anything. On the web site, everything is 1.4.1.&lt;/p&gt;


&lt;p&gt;CU&lt;/p&gt;

&lt;p&gt;Arno&lt;/p&gt;</comment>
                </comments>
    
    <attachments>
            <attachment id="12367386" name="FTPFileLoadlib.java" size="2178" author="aunkrig" created="Tue, 9 Oct 2007 12:21:46 -0700 (PDT)" />
            <attachment id="12367387" name="FTPFilePO.java" size="1976" author="aunkrig" created="Tue, 9 Oct 2007 12:22:11 -0700 (PDT)" />
            <attachment id="12367388" name="FTPFilePOMember.java" size="2459" author="aunkrig" created="Tue, 9 Oct 2007 12:22:31 -0700 (PDT)" />
            <attachment id="12367389" name="MvsFTPUtil.java" size="9279" author="aunkrig" created="Tue, 9 Oct 2007 12:22:57 -0700 (PDT)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-170] UnixFTPEntryParser does not handle file owner names with spaces</title>
<link>http://issues.apache.org/jira/browse/NET-170</link>

                    <description>The regex in UnixFTPEntryParser does not cope with the situation where the file owner name contains spaces. A patch was previously submitted to fix group names with spaces but a similar bug also affects the owner name. As a result, a call to FTPClient.listFiles() returns a FTPFile[] which does not contain entries for affected files.</description>
                <environment>observed in v1.4.0 but also affects latest dev version as well&lt;br/&gt;
windows xp / jboss 4.0.4.GA  connecting to Novell Netware FTP server</environment>
            <key id="12378548">NET-170</key>
        <summary>UnixFTPEntryParser does not handle file owner names with spaces</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="bryndavies">Bryn Davies</reporter>
            
    <created>Tue, 18 Sep 2007 07:48:26 -0700 (PDT)</created>
    <updated>Tue, 19 Feb 2008 14:29:46 -0800 (PST)</updated>

                        <version>1.4</version>
            
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-169] Cannot return files with listNames() function</title>
<link>http://issues.apache.org/jira/browse/NET-169</link>

                    <description>Hi, &lt;br/&gt;
I am connecting to an ftp server with my username and password. When I call ftpClient.listNames();  it returns 0 length string array although i am very sure that there are files inside. 

&lt;p&gt;I also know that when I changed the ftp server to another one this function works. So I am assuming the server that I connected has a weird ftp server. When I called the function ftpClient.getSystemName() it returns UNKNOWN Type: L8.&lt;br/&gt;
If I call ftpClient.listNames I got this exception&lt;br/&gt;
 org.apache.commons.net.ftp.parser.ParserInitializationException: Unknown parser type: UNKNOWN Type: L8&lt;br/&gt;
	at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createFileEntryParser(DefaultFTPFileEntryParserFactory.java:125)&lt;br/&gt;
	at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2362)&lt;br/&gt;
	at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2145)&lt;br/&gt;
	at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2192)&lt;/p&gt;

&lt;p&gt;I have to get the filenames from the server, so how can I solve the problem.&lt;br/&gt;
Thanks for the helps.&lt;br/&gt;
Burak Ulutoprak&lt;/p&gt;</description>
                <environment>Windows, Eclipse</environment>
            <key id="12377107">NET-169</key>
        <summary>Cannot return files with listNames() function</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="bulutopra">burak ulutoprak</reporter>
            
    <created>Wed, 29 Aug 2007 09:56:08 -0700 (PDT)</created>
    <updated>Wed, 12 Mar 2008 14:03:15 -0700 (PDT)</updated>

                        <version>1.4</version>
            
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>1</votes>
    
                                        

            <comments>
                    <comment id="12553306" author="jodeleit" created="Wed, 19 Dec 2007 03:11:25 -0800 (PST)"  >I can reproduce the problem against a &quot;ProFTPD 1.2.10 Server&quot;.&lt;br/&gt;
I tracked and suspect the method &quot;org.apache.commons.net.ftp.FTPClient#initiateListParsing(FTPFileEntryParser, String)&quot; (is called by &quot;org.apache.commons.net.ftp.FTPClient#listFiles(String)&quot;).

&lt;p&gt;The suspected code is:&lt;/p&gt;

&lt;p&gt;        if ((socket = &lt;em&gt;openDataConnection&lt;/em&gt;(FTPCommand.LIST, pathname)) == null)&lt;/p&gt;
        {
            return engine; // we end up here!
        }

&lt;p&gt;(see &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://commons.apache.org/net/xref/org/apache/commons/net/ftp/FTPClient.html#2392&quot;&gt;http://commons.apache.org/net/xref/org/apache/commons/net/ftp/FTPClient.html#2392&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;)&lt;/p&gt;

&lt;p&gt;If i set a breakpoint at this line &quot;getReplyString()&quot; delivers &quot;200 PORT command successful&quot;.&lt;/p&gt;

&lt;p&gt;The trace of my use case (delete a directory recursivly) with logging turned on:&lt;/p&gt;

&lt;p&gt;TRACE 19.12.2007 12:02:41.621 (de.espirit.firstspirit.io.FtpFileSystemOperations): SENT: LIST LIST /home/tomcat/webapps/intranet/test&lt;br/&gt;
TRACE 19.12.2007 12:02:41.621 (de.espirit.firstspirit.io.FtpFileSystemOperations): RECEIVED: 200 PORT command successful&lt;br/&gt;
DEBUG 19.12.2007 12:02:41.621 (de.espirit.firstspirit.io.FtpFileSystemOperations): no files in path /home/tomcat/webapps/intranet/test&lt;br/&gt;
TRACE 19.12.2007 12:02:41.621 (de.espirit.firstspirit.io.FtpFileSystemOperations): SENT: RMD RMD /home/tomcat/webapps/intranet/test&lt;br/&gt;
WARN  19.12.2007 12:02:41.621 (de.espirit.firstspirit.io.FtpFileSystemOperations): RECEIVED: 425 Unable to build data connection: Connection refused&lt;/p&gt;

&lt;p&gt;The same RMD command on the shell:&lt;/p&gt;

&lt;p&gt;&amp;gt;ftp XXXXX&lt;br/&gt;
Verbindung mit corona.e-spirit.de wurde hergestellt.&lt;br/&gt;
220 ProFTPD 1.2.10 Server (XXXXX) &lt;span class=&quot;error&quot;&gt;&amp;#91;XXX.XXX.XXX.XXX&amp;#93;&lt;/span&gt;&lt;br/&gt;
Benutzer (XXXXX:(none)): xxxxxx&lt;br/&gt;
331 Password required for xxxxxx.&lt;br/&gt;
Kennwort:&lt;br/&gt;
230 User xxxxxx logged in.&lt;br/&gt;
ftp&amp;gt; rmdir /home/tomcat/webapps/intranet/test&lt;br/&gt;
550 /home/tomcat/webapps/intranet/test: Directory not empty&lt;br/&gt;
ftp&amp;gt; dir /home/tomcat/webapps/intranet/test&lt;br/&gt;
200 PORT command successful&lt;br/&gt;
150 Opening ASCII mode data connection for file list&lt;br/&gt;
&lt;del&gt;rw-r&lt;/del&gt;&lt;del&gt;r&lt;/del&gt;-   1 intranetftp intranet       86 Dec 19 11:02 test.bin&lt;br/&gt;
226 Transfer complete.&lt;br/&gt;
FTP: 64d Bytes empfangen in 0,00Sekunden 68000,00KB/s&lt;br/&gt;
ftp&amp;gt;&lt;/p&gt;

</comment>
                    <comment id="12578017" author="sebb@apache.org" created="Wed, 12 Mar 2008 14:03:15 -0700 (PDT)"  >Also applied to trunk (version 1.5) in r636508</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-161] TFTP TFTPClient.sendFile() just doesen&apos;t work</title>
<link>http://issues.apache.org/jira/browse/NET-161</link>

                    <description>sendFile() in TFTP sendFile() method does not work. It does not causes an error.&lt;br/&gt;
Looks like there is a bug in the communication.&lt;br/&gt;
I testet it with a sniffer. &lt;br/&gt;
1. write request looks ok&lt;br/&gt;
2. aknowlege from server &lt;br/&gt;
3. aknowlege from server&lt;br/&gt;
4. aknowlege from server&lt;br/&gt;
and so on.&lt;br/&gt;
I replaced the lib with version 1.1 and it works now.</description>
                <environment>Win xp, all java versions tested.</environment>
            <key id="12370119">NET-161</key>
        <summary>TFTP TFTPClient.sendFile() just doesen&apos;t work</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="peterli">Peter Schmid</reporter>
            
    <created>Thu, 24 May 2007 01:26:42 -0700 (PDT)</created>
    <updated>Tue, 19 Feb 2008 14:41:57 -0800 (PST)</updated>

                        <version>1.4</version>
            
                        <fixVersion>2.0</fixVersion>
                    <fixVersion>1.5</fixVersion>
            
                
            <due></due>
    
            <votes>1</votes>
    
                                        

            <comments>
                    <comment id="12559764" author="armbrust" created="Wed, 16 Jan 2008 16:35:35 -0800 (PST)"  >This is because issue &lt;a href=&quot;http://issues.apache.org/jira/browse/NET-68&quot; title=&quot;[net] TFTPClient&apos;s send file discards last ack&quot;&gt;&lt;del&gt;NET-68&lt;/del&gt;&lt;/a&gt; STILL has not been fixed.  Someone provided a working patch in that bug report, but it was never applied to the 1.4 trunk.  The TFTP sendFile method remains useless in the current released version.</comment>
                    <comment id="12559765" author="armbrust" created="Wed, 16 Jan 2008 16:36:12 -0800 (PST)"  >This fix needs to be applied!</comment>
                    <comment id="12560005" author="armbrust" created="Thu, 17 Jan 2008 09:25:05 -0800 (PST)"  >I think that there is some confusion as to which patch needs to be applied.  The TFTPClient send file method had numerous errors in the implementation, I doubt that it has ever worked right.  &lt;a href=&quot;http://issues.apache.org/jira/browse/NET-68&quot; title=&quot;[net] TFTPClient&apos;s send file discards last ack&quot;&gt;&lt;del&gt;NET-68&lt;/del&gt;&lt;/a&gt; contains a patch, which has already been applied - but does not fix all of  the problems.  

&lt;p&gt;&lt;a href=&quot;http://issues.apache.org/jira/browse/NET-68&quot; title=&quot;[net] TFTPClient&apos;s send file discards last ack&quot;&gt;&lt;del&gt;NET-68&lt;/del&gt;&lt;/a&gt; contains a zip (TFTPStuff.zip) file, which does fix the problem, and makes the method work properly.&lt;br/&gt;
I have created a diff of the new TFTPClient that Jennifer Hodgdon wrote in her attached TFTPStuff.zip - diffed against 1.4.1.&lt;/p&gt;

&lt;p&gt;Would someone please apply this patch, and perhaps we can get a 1.4.2 build?  This is a serious lack of functionality.  &lt;br/&gt;
This is the patch that needs to be applied to 1.4.1:&lt;/p&gt;

&lt;p&gt;&amp;#8212; TFTPClient.java.orig	2005-12-03 10:05:48.000000000 -0600&lt;br/&gt;
+++ TFTPClient.java	2008-01-17 10:55:07.000000000 -0600&lt;br/&gt;
@@ -360,7 +360,7 @@&lt;br/&gt;
     public void sendFile(String filename, int mode, InputStream input,&lt;br/&gt;
                          InetAddress host, int port) throws IOException&lt;br/&gt;
     {&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;int bytesRead, timeouts, lastBlock, block, hostPort, dataLength, offset;&lt;br/&gt;
+        int bytesRead, timeouts, lastBlock, block, hostPort, dataLength, offset, totalThisPacket;&lt;br/&gt;
         TFTPPacket sent, received = null;&lt;br/&gt;
         TFTPErrorPacket error;&lt;br/&gt;
         TFTPDataPacket data =&lt;br/&gt;
@@ -368,9 +368,11 @@&lt;br/&gt;
         ;&lt;br/&gt;
         TFTPAckPacket ack;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;+        boolean justStarted = true;&lt;br/&gt;
+        &lt;br/&gt;
         beginBufferedOps();&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;dataLength = lastBlock = hostPort = bytesRead = 0;&lt;br/&gt;
+        dataLength = lastBlock = hostPort = bytesRead = totalThisPacket = 0;&lt;br/&gt;
         block = 0;&lt;br/&gt;
         boolean lastAckWait = false;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;@@ -383,11 +385,16 @@&lt;br/&gt;
 _sendPacket:&lt;br/&gt;
         do&lt;br/&gt;
         {&lt;br/&gt;
+            // first time: block is 0, lastBlock is 0, send a request packet.&lt;br/&gt;
+            // subsequent: block is integer starting at 1, send data packet.&lt;br/&gt;
             bufferedSend(sent);&lt;br/&gt;
-&lt;br/&gt;
+            &lt;br/&gt;
+            // this is trying to receive an ACK&lt;br/&gt;
 _receivePacket:&lt;br/&gt;
             while (true)&lt;br/&gt;
             {&lt;br/&gt;
+                &lt;br/&gt;
+&lt;br/&gt;
                 timeouts = 0;&lt;br/&gt;
                 while (timeouts &amp;lt; __maxTimeouts)&lt;/p&gt;
                 {
@@ -419,12 +426,13 @@
                         endBufferedOps();
                         throw new IOException(&quot;Bad packet: &quot; + e.getMessage());
                     }
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;}&lt;br/&gt;
+                } // end of while loop over tries to receive&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;                 // The first time we receive we get the port number and&lt;br/&gt;
         // answering host address (for hosts with multiple IPs)&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;if (lastBlock == 0)&lt;br/&gt;
+                if (justStarted)&lt;br/&gt;
                 {&lt;br/&gt;
+                    justStarted = false;&lt;br/&gt;
                     hostPort = received.getPort();&lt;br/&gt;
                     data.setPort(hostPort);&lt;br/&gt;
                     if(!host.equals(received.getAddress()))&lt;br/&gt;
@@ -456,10 +464,13 @@&lt;br/&gt;
                         if (lastBlock == block)&lt;br/&gt;
                         {&lt;br/&gt;
                             ++block;&lt;/li&gt;
	&lt;li&gt;if (lastAckWait)&lt;br/&gt;
+                            if (lastAckWait) {
+                                
                               break _sendPacket;
-                            else
+                            }&lt;br/&gt;
+                            else {
                               break _receivePacket;
+                            }&lt;br/&gt;
                         }&lt;br/&gt;
                         else
                         {
@@ -492,21 +503,33 @@
                 //break;
             }&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;+            // OK, we have just gotten ACK about the last data we sent. Make another&lt;br/&gt;
+            // and send it            &lt;br/&gt;
+&lt;br/&gt;
             dataLength = TFTPPacket.SEGMENT_SIZE;&lt;br/&gt;
             offset = 4;&lt;br/&gt;
+            totalThisPacket = 0;&lt;br/&gt;
             while (dataLength &amp;gt; 0 &amp;amp;&amp;amp;&lt;br/&gt;
                     (bytesRead = input.read(_sendBuffer, offset, dataLength)) &amp;gt; 0)&lt;/p&gt;
             {
                 offset += bytesRead;
                 dataLength -= bytesRead;
+                totalThisPacket += bytesRead;
             }

&lt;p&gt;+            if( totalThisPacket &amp;lt; TFTPPacket.SEGMENT_SIZE ) {
+                /* this will be our last packet -- send, wait for ack, stop */
+                lastAckWait = true;
+            }&lt;br/&gt;
             data.setBlockNumber(block);&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;data.setData(_sendBuffer, 4, offset - 4);&lt;br/&gt;
+            data.setData(_sendBuffer, 4, totalThisPacket);&lt;br/&gt;
             sent = data;&lt;br/&gt;
         }&lt;/li&gt;
	&lt;li&gt;while (dataLength == 0 || lastAckWait);&lt;br/&gt;
-&lt;br/&gt;
+        while ( totalThisPacket &amp;gt; 0 || lastAckWait );&lt;br/&gt;
+        // Note: this was looping while dataLength == 0 || lastAckWait,&lt;br/&gt;
+        // which was discarding the last packet if it was not full size&lt;br/&gt;
+        // Should send the packet. &lt;br/&gt;
+        &lt;br/&gt;
         endBufferedOps();&lt;br/&gt;
     }&lt;/li&gt;
&lt;/ul&gt;

</comment>
                    <comment id="12560006" author="armbrust" created="Thu, 17 Jan 2008 09:27:52 -0800 (PST)"  >Looks like Jira doesn&apos;t like inline patches - so I&apos;ve attached the patch that I pasted into the previous comment.</comment>
                </comments>
    
    <issuelinks>
                <issuelinktype id="10032">
            <name>Blocker</name>
                            <outwardlinks description="blocks">
                            <issuelink>
            <issuekey id="12341961">NET-68</issuekey>
        </issuelink>
                    </outwardlinks>
                                </issuelinktype>
            </issuelinks>
    <attachments>
            <attachment id="12373411" name="TFTPClient-1.4.1-fix.diff" size="3976" author="armbrust" created="Thu, 17 Jan 2008 09:27:52 -0800 (PST)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-157] Get &quot;hidden files&quot; over ftp, using commons-vfs</title>
<link>http://issues.apache.org/jira/browse/NET-157</link>

                    <description>I was trying to show &quot;hidden files&quot; by using commons-vfs, but I found no solution to do this by the way.&lt;br/&gt;
So I have patched the FTPClient - Class in commons-net 2.0.&lt;br/&gt;
The Default-Constructor sets the &quot;__listHiddenFiles&quot; property to false. I change the property to true.  

&lt;p&gt;-----------------------------&lt;/p&gt;

&lt;p&gt;&quot;__listHiddenFiles = true;&quot;&lt;/p&gt;

&lt;p&gt;-----------------------------&lt;/p&gt;

&lt;p&gt;The next necessary change I made, was in the &quot;getListArguments&quot; method:&lt;/p&gt;

&lt;p&gt;      -----------------------------&lt;/p&gt;

&lt;p&gt;protected String getListArguments(String pathname) {&lt;br/&gt;
if (getListHiddenFiles() &amp;amp;&amp;amp; pathname != null) {
  StringBuffer sb = new StringBuffer().append(&quot;-a &quot;).append(pathname);
  pathname = sb.toString();
  } else if (getListHiddenFiles()) {
  pathname = &quot;-a &quot;;
 }&lt;br/&gt;
  return pathname;&lt;br/&gt;
 }&lt;/p&gt;

&lt;p&gt; -----------------------------&lt;/p&gt;

&lt;p&gt;Maybe you can integrate this patch in your next apache.commons.net version?  &lt;/p&gt;</description>
                <environment>jdk1.5.0_07 ; Linux </environment>
            <key id="12367147">NET-157</key>
        <summary>Get &quot;hidden files&quot; over ftp, using commons-vfs</summary>
        <type id="5" iconUrl="http://issues.apache.org/jira/images/icons/improvement.gif">Wish</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="johnny">Michael Labicki</reporter>
            
    <created>Fri, 13 Apr 2007 05:26:26 -0700 (PDT)</created>
    <updated>Sun, 17 Feb 2008 16:09:05 -0800 (PST)</updated>

                        <version>2.0</version>
            
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-155] Integer is too small to hold article number value (NNTPClient __parseNewsgroupListEntry() function)</title>
<link>http://issues.apache.org/jira/browse/NET-155</link>

                    <description>running the following code:

&lt;p&gt;  client.connect(&quot;news.icm.edu.pl&quot;);&lt;br/&gt;
  NewsgroupInfo[] grps = client.listNewsgroups();&lt;/p&gt;

&lt;p&gt;results MalformedServerReplyException (alt.atheism 2147485259 2147483647 y)&lt;/p&gt;

&lt;p&gt;it&apos;s because in function NNTPClient.__parseNewsgroupListEntry():&lt;/p&gt;

&lt;p&gt;last = tokenizer.nextToken();&lt;br/&gt;
        first = tokenizer.nextToken();&lt;br/&gt;
        permission = tokenizer.nextToken();&lt;/p&gt;

&lt;p&gt;        try&lt;/p&gt;
        {
            lastNum = Integer.parseInt(last);
            firstNum = Integer.parseInt(first);
            result._setFirstArticle(firstNum);
            result._setLastArticle(lastNum);

	    if((firstNum == 0) &amp;amp;&amp;amp; (lastNum == 0))
		    result._setArticleCount(0);
	    else
		    result._setArticleCount(lastNum - firstNum + 1);
        }
&lt;p&gt;        catch (NumberFormatException e)&lt;/p&gt;
        {
            return null;
        }

&lt;p&gt;lastNum and firstNum are Integer (too small for received values)&lt;/p&gt;
</description>
                <environment>any</environment>
            <key id="12365786">NET-155</key>
        <summary>Integer is too small to hold article number value (NNTPClient __parseNewsgroupListEntry() function)</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="uhzzre">Krzysztof Jakubczyk</reporter>
            
    <created>Mon, 26 Mar 2007 01:50:49 -0700 (PDT)</created>
    <updated>Wed, 19 Sep 2007 22:31:24 -0700 (PDT)</updated>

                        <version>1.4</version>
            
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12485225" author="rwinston@eircom.net" created="Thu, 29 Mar 2007 08:36:30 -0700 (PDT)"  >Fix applied.</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-151] [PATCH] Allow user to force passive connections to use connected host in FTPClient</title>
<link>http://issues.apache.org/jira/browse/NET-151</link>

                    <description>Currently, FTPClient always uses the host and port returned to it from the reply to a passive connection request.&lt;br/&gt;
Some FTP hosts are set incorrectly or are set behind a NAT so they report the incorrect IP address to use for the connection and the transfer will fail to connect.&lt;br/&gt;
This patch allows the user to tell FTPClient to use the connected host instead of the host given from the passive reply.&lt;br/&gt;
Doing so will allow successful transfers even when the report FTP server returns an incorrect IP address.</description>
                <environment>Windows XP, Java 1.5.0, Intel processor</environment>
            <key id="12362659">NET-151</key>
        <summary>[PATCH] Allow user to force passive connections to use connected host in FTPClient</summary>
        <type id="4" iconUrl="http://issues.apache.org/jira/images/icons/improvement.gif">Improvement</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="neilagg">Neil Aggarwal</reporter>
            
    <created>Mon, 12 Feb 2007 21:24:46 -0800 (PST)</created>
    <updated>Thu, 15 Feb 2007 14:33:35 -0800 (PST)</updated>

                        <version>2.0</version>
            
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12472528" author="neilagg" created="Mon, 12 Feb 2007 21:25:49 -0800 (PST)"  >Patch for FTPClient</comment>
                    <comment id="12472727" author="neilagg" created="Tue, 13 Feb 2007 07:53:02 -0800 (PST)"  >Steffen Heil &lt;span class=&quot;error&quot;&gt;&amp;#91;lists@steffen-heil.de&amp;#93;&lt;/span&gt; suggested to use a method with this signature:&lt;br/&gt;
overrideHostForPassiveConnections(InetAddress)&lt;br/&gt;
which is a more elegant solution.

&lt;p&gt;This patch implements that method.  Use this instead of the previous patch.&lt;/p&gt;</comment>
                    <comment id="12473541" author="rwinston@eircom.net" created="Thu, 15 Feb 2007 14:33:35 -0800 (PST)"  >Patch applied. </comment>
                </comments>
    
    <attachments>
            <attachment id="12350999" name="FTPClient.patch.txt" size="2574" author="neilagg" created="Mon, 12 Feb 2007 21:25:49 -0800 (PST)" />
            <attachment id="12351048" name="FTPClientOverrideHost.patch.txt" size="1970" author="neilagg" created="Tue, 13 Feb 2007 07:53:02 -0800 (PST)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-148] Relaxed condition in __getReply causes other failures.</title>
<link>http://issues.apache.org/jira/browse/NET-148</link>

                    <description>In FTP.java&apos;s __getReply() method, this do/while loop reads multi-line responses from the server:

&lt;p&gt;            do&lt;/p&gt;
            {
                line = _controlInput.readLine();
...
            }
&lt;p&gt;            while (!(line.length() &amp;gt;= 4 &amp;amp;&amp;amp; line.charAt(3) != &apos;-&apos; &amp;amp;&amp;amp;&lt;br/&gt;
                     Character.isDigit(line.charAt(0))));&lt;br/&gt;
            // This is too strong a condition because of non-conforming ftp&lt;br/&gt;
            // servers like ftp.funet.fi which sent 226 as the last line of a&lt;br/&gt;
            // 426 multi-line reply in response to ls /.  We relax the condition to&lt;br/&gt;
            // test that the line starts with a digit rather than starting with&lt;br/&gt;
            // the code.&lt;br/&gt;
            // line.startsWith(code)));&lt;br/&gt;
        }&lt;/p&gt;

&lt;p&gt;Note the comment and the commented-out termination condition.  I think the relevant spec is &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://www.ietf.org/rfc/rfc0959.txt&quot;&gt;http://www.ietf.org/rfc/rfc0959.txt&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;  and the section is &quot;4.2.  FTP REPLIES&quot;.  This is causing problems with the return from the STAT command from Geocities&apos; FTP servers.  Here is an example reply.&lt;/p&gt;

&lt;p&gt;211- ftp.us.geocities.com FTP server status: &lt;br/&gt;
     Version wu-2.6.0(48) Tue Jan 2 16:30:15 PST 2007 &lt;br/&gt;
 Connected to 144.212.217.85 &lt;br/&gt;
 Logged in anonymously &lt;br/&gt;
 TYPE: ASCII, FORM: Nonprint; STRUcture: File; transfer MODE: Stream &lt;br/&gt;
 No data connection &lt;br/&gt;
 0 data bytes received in 0 files &lt;br/&gt;
 0 data bytes transmitted in 0 files &lt;br/&gt;
0 data bytes total in 0 files &lt;br/&gt;
57 traffic bytes received in 0 transfers &lt;br/&gt;
733 traffic bytes transmitted in 0 transfers &lt;br/&gt;
834 traffic bytes total in 0 transfers &lt;br/&gt;
211  End of status&lt;/p&gt;

&lt;p&gt;Note that the line &quot;0 data bytes total in 0 files&quot; starts with a digit, but it isn&apos;t a reply code.  This prematurely halts reading of lines from the server, and the remaining lines will look like a reply from the next command.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12359831">NET-148</key>
        <summary>Relaxed condition in __getReply causes other failures.</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="rwinston@eircom.net">Rory Winston</assignee>
            
                        <reporter username="matthewsim">Matthew Simoneau</reporter>
            
    <created>Thu, 4 Jan 2007 15:30:37 -0800 (PST)</created>
    <updated>Thu, 21 Feb 2008 15:05:51 -0800 (PST)</updated>

                        <version>1.4</version>
                    <version>Nightly Builds</version>
            
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12485219" author="rwinston@eircom.net" created="Thu, 29 Mar 2007 08:29:31 -0700 (PDT)"  >I have tried this with Geocities servers, but I cant reproduce the issue with 2.0 RC? Can you provide some more info?</comment>
                    <comment id="12498047" author="matthewsim" created="Tue, 22 May 2007 15:43:49 -0700 (PDT)"  >This is still broken in the nightly build.  Here is a simple Java program that will reproduce this.

&lt;p&gt;import org.apache.commons.net.ftp.FTPClient;&lt;/p&gt;

&lt;p&gt;public class FTPTest {&lt;br/&gt;
    public static void main(String[] args) throws Exception {
        FTPClient ftpClient = new FTPClient();
        ftpClient.connect(&quot;ftp.us.geocities.com&quot;,21);
        ftpClient.login(&quot;anonymous&quot;,&quot;anonymous@example.com&quot;);
        ftpClient.getStatus();
        System.out.println(ftpClient.listFiles());
        ftpClient.disconnect();
    }&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;getStatus() stops reading lines prematurely, which sets up listFiles() to fail.&lt;/p&gt;</comment>
                    <comment id="12498429" author="rwinston@eircom.net" created="Wed, 23 May 2007 16:59:43 -0700 (PDT)"  >Thanks Matthew , that is very helpful. I can reproduce the issue now. I think we may need to modify that condition to fix this. </comment>
                    <comment id="12570706" author="rwinston@eircom.net" created="Wed, 20 Feb 2008 06:46:05 -0800 (PST)"  >Ok, I think the best way to do this may be to revert to the previous (more strict) behaviour for default operation, but add a parameter (settable on the FTPClient) which allows the user to enable strict or lenient multiline parsing.</comment>
                    <comment id="12571222" author="rwinston@eircom.net" created="Thu, 21 Feb 2008 15:05:51 -0800 (PST)"  >This is now fixed. In order to get the broken test case to work, add the following line before connect():

&lt;p&gt;ftpClient.setStrictMultilineParsing(true);&lt;/p&gt;

&lt;p&gt;This will enable the client to parse the responses correctly.&lt;/p&gt;</comment>
                </comments>
    
    <issuelinks>
                <issuelinktype id="12310020">
            <name>Dependants</name>
                                        <inwardlinks description="blocks">
                            <issuelink>
            <issuekey id="12382064">NET-174</issuekey>
        </issuelink>
                    </inwardlinks>
                    </issuelinktype>
            </issuelinks>
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-146] wrong handling of timeouts</title>
<link>http://issues.apache.org/jira/browse/NET-146</link>

                    <description>If you set a timeout on the control connection and then make a data transfer (upload, download) which takes longer than that timeout, the client throws the following exception. It seems like the client tries to read something from the control connection while the data transfer is in progress and then it just throws an exception. It makes the application think that the transfer failed even though it succeeded.

&lt;p&gt;aused by: java.net.SocketTimeoutException: Read timed out&lt;br/&gt;
        at java.net.SocketInputStream.socketRead0(Native Method)&lt;br/&gt;
        at java.net.SocketInputStream.read(SocketInputStream.java:129)&lt;br/&gt;
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)&lt;br/&gt;
        at java.io.BufferedInputStream.read(BufferedInputStream.java:235)&lt;br/&gt;
        at java.io.FilterInputStream.read(FilterInputStream.java:66)&lt;br/&gt;
        at java.io.PushbackInputStream.read(PushbackInputStream.java:120)&lt;br/&gt;
        at org.apache.commons.net.io.FromNetASCIIInputStream.__read(FromNetASCIIInputStream.java:75)&lt;br/&gt;
        at org.apache.commons.net.io.FromNetASCIIInputStream.read(FromNetASCIIInputStream.java:170)&lt;br/&gt;
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)&lt;br/&gt;
        at java.io.BufferedInputStream.read(BufferedInputStream.java:235)&lt;br/&gt;
        at org.apache.commons.net.telnet.TelnetInputStream.__read(TelnetInputStream.java:114)&lt;br/&gt;
        at org.apache.commons.net.telnet.TelnetInputStream.run(TelnetInputStream.java:535)&lt;br/&gt;
        at java.lang.Thread.run(Thread.java:595)&lt;/p&gt;</description>
                <environment>linux 2.6, java 1.5.0_08 (but most probably any environment)</environment>
            <key id="12358952">NET-146</key>
        <summary>wrong handling of timeouts</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="koloom@yahoo.com">Koloom</reporter>
            
    <created>Mon, 18 Dec 2006 12:57:49 -0800 (PST)</created>
    <updated>Wed, 20 Dec 2006 02:54:17 -0800 (PST)</updated>

                        <version>1.4</version>
            
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12459460" author="koloom@yahoo.com" created="Mon, 18 Dec 2006 13:02:14 -0800 (PST)"  >Following is an InputStream implementation which slows down the data transfer (upload). Just to make your testing easier &lt;img class=&quot;emoticon&quot; src=&quot;https://issues.apache.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;. I could not attach the complete test since I use another layer on top of commons-net and I am not free to distribute it.

&lt;p&gt;	public class DelayedByteArrayInputStream extends InputStream {&lt;br/&gt;
		private byte[] data;&lt;br/&gt;
		private int position;&lt;br/&gt;
		private long chunkDelay;&lt;br/&gt;
		private final static int CHUNK = 10000;&lt;/p&gt;

&lt;p&gt;		public DelayedByteArrayInputStream(byte[] data, long time) {
			this.data = data;
			position = 0;
			double x = time / (data.length / CHUNK);
			chunkDelay = Math.round(Math.ceil(x));
		}&lt;/p&gt;

&lt;p&gt;		public int read() throws IOException {&lt;br/&gt;
			if (position % CHUNK == 0) {&lt;br/&gt;
				try {
					Thread.sleep(chunkDelay);
				}&lt;br/&gt;
				catch (InterruptedException e) {
					throw new IOException(&quot;sleep interrupted&quot;);
				}&lt;br/&gt;
			}&lt;br/&gt;
			return position &amp;lt; data.length ? data&lt;span class=&quot;error&quot;&gt;&amp;#91;position++&amp;#93;&lt;/span&gt; : -1;&lt;br/&gt;
		}&lt;br/&gt;
	}&lt;/p&gt;</comment>
                    <comment id="12459476" author="rwinston@eircom.net" created="Mon, 18 Dec 2006 13:47:22 -0800 (PST)"  >Hi&lt;br/&gt;
Can you post the code where you are setting the timeout? I cant reproduce the problem...

&lt;p&gt;Have you tried the latest RC of net-2.0 ? You can find it here:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://people.apache.org/~rwinston/commons-net-2.0/commons-net-ftp-2.0.0-SNAPSHOT.jar&quot;&gt;http://people.apache.org/~rwinston/commons-net-2.0/commons-net-ftp-2.0.0-SNAPSHOT.jar&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</comment>
                    <comment id="12459749" author="dfs@apache.org" created="Tue, 19 Dec 2006 12:18:31 -0800 (PST)"  > The documentation for FTPClient in Commons Net 1.4.1 says:&lt;br/&gt;
&amp;gt;NOTE: If you experience problems with unwanted firing of.&lt;br/&gt;
&amp;gt;setSoTimeout() during periods of client inactivity, this can be alleviated by calling&lt;br/&gt;
&amp;gt;setReaderThread(false). For more details, see this thread (&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://issues.apache.org/bugzilla/show_bug.cgi?id=31122&quot;&gt;http://issues.apache.org/bugzilla/show_bug.cgi?id=31122&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;).</comment>
                    <comment id="12459765" author="dfs@apache.org" created="Tue, 19 Dec 2006 13:29:30 -0800 (PST)"  >After reviewing the old bugzilla issue, I think the problem is that the telnet protocol implementation for the control connection always sits in a read waiting for events (and that read is timing out).  If that read were started only after the data transfer completed, it wouldn&apos;t time out.  If that&apos;s the case, then, yes, that would be a bug and that&apos;s why disabling the reader thread works around the problem. Rory&apos;s changes for 2.0 won&apos;t have the problem because it doesn&apos;t use TelnetClient.</comment>
                    <comment id="12459892" author="rwinston@eircom.net" created="Wed, 20 Dec 2006 02:54:17 -0800 (PST)"  >Fixed in 2.0 branch.</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-145] Deadlock in TelnetInputStream</title>
<link>http://issues.apache.org/jira/browse/NET-145</link>

                    <description>&quot;Sometimes&quot; single threads of our application (each thread transfering data from ftp servers) get locked forever. When monitoring our tool with JConsole, I can see that such a thread usually hangs at org.apache.commons.net.telnet.TelnetInputStream, line 339.

&lt;p&gt;This line contains the statement &lt;br/&gt;
__queue.wait();&lt;/p&gt;

&lt;p&gt;Unfortunately I haven&apos;t found a way to reproduce this issue, it just happens about once a day (while running 24 hours and transfering about 50000 files).&lt;/p&gt;

&lt;p&gt;As a quick and dirty workaround: What do you think about replacing this line with something like&lt;br/&gt;
long startTime = System.currentTimeMillis();&lt;br/&gt;
__queue.wait(60000);&lt;br/&gt;
if ((System.currentTimeMillis() - startTime) &amp;gt; 55000) {&lt;br/&gt;
    throw new InterruptedException(&quot;Unknown strange and nasty blocker detected&quot;);&lt;br/&gt;
} &lt;/p&gt;

&lt;p&gt;So at least it would not just block the thread.&lt;/p&gt;</description>
                <environment>Heavy mutlithreaded environment using Jakarta VFS (which uses Commons Net) for ftp file transfers</environment>
            <key id="12357122">NET-145</key>
        <summary>Deadlock in TelnetInputStream</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="snowbird">Norbert Seekircher</reporter>
            
    <created>Tue, 28 Nov 2006 05:40:22 -0800 (PST)</created>
    <updated>Wed, 3 Jan 2007 08:16:05 -0800 (PST)</updated>

                        <version>1.4</version>
            
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12453993" author="rwinston@eircom.net" created="Tue, 28 Nov 2006 08:19:15 -0800 (PST)"  >Norbert

&lt;p&gt;This should be fixed in the snapshot of commons-net-2.0, although this requires JDK 1.5+. If you are in a position to test this, it would be great if you can verify if it works or not:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://people.apache.org/~rwinston/commons-net-2.0/commons-net-ftp-2.0.0-SNAPSHOT.jar&quot;&gt;http://people.apache.org/~rwinston/commons-net-2.0/commons-net-ftp-2.0.0-SNAPSHOT.jar&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;</comment>
                    <comment id="12454907" author="snowbird" created="Fri, 1 Dec 2006 05:58:49 -0800 (PST)"  >Thanks Rory,

&lt;p&gt;we will test this build and report back&lt;/p&gt;</comment>
                    <comment id="12459890" author="rwinston@eircom.net" created="Wed, 20 Dec 2006 02:53:06 -0800 (PST)"  >This issue is fixed in 2.0.</comment>
                    <comment id="12461984" author="mcampelo" created="Wed, 3 Jan 2007 08:05:32 -0800 (PST)"  >This deadlock happens when you lost the connection with the FTP server and tries to send a logout () command.

&lt;p&gt;Find below the thead dump from a Solaris box:&lt;/p&gt;

&lt;p&gt;Full thread dump Java HotSpot(TM) Client VM (1.4.2_08-b03 mixed mode):&lt;/p&gt;

&lt;p&gt;&quot;Thread-0&quot; daemon prio=6 tid=0x001cbf18 nid=0x9 runnable &lt;span class=&quot;error&quot;&gt;&amp;#91;f9a7f000..f9a7fc30&amp;#93;&lt;/span&gt;&lt;br/&gt;
        at java.net.SocketInputStream.socketRead0(Native Method)&lt;br/&gt;
        at java.net.SocketInputStream.read(SocketInputStream.java:129)&lt;br/&gt;
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)&lt;br/&gt;
        at java.io.BufferedInputStream.read(BufferedInputStream.java:201)&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;locked &amp;lt;0xf1845a20&amp;gt; (a java.io.BufferedInputStream)&lt;br/&gt;
        at java.io.FilterInputStream.read(FilterInputStream.java:66)&lt;br/&gt;
        at java.io.PushbackInputStream.read(PushbackInputStream.java:120)&lt;br/&gt;
        at org.apache.commons.net.io.FromNetASCIIInputStream.__read(FromNetASCIIInputStream.java:75)&lt;br/&gt;
        at org.apache.commons.net.io.FromNetASCIIInputStream.read(FromNetASCIIInputStream.java:170)&lt;br/&gt;
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)&lt;br/&gt;
        at java.io.BufferedInputStream.read(BufferedInputStream.java:201)&lt;/li&gt;
	&lt;li&gt;locked &amp;lt;0xf1846988&amp;gt; (a org.apache.commons.net.telnet.TelnetInputStream)&lt;br/&gt;
        at org.apache.commons.net.telnet.TelnetInputStream.__read(TelnetInputStream.java:114)&lt;br/&gt;
        at org.apache.commons.net.telnet.TelnetInputStream.run(TelnetInputStream.java:535)&lt;br/&gt;
        at java.lang.Thread.run(Thread.java:534)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&quot;Signal Dispatcher&quot; daemon prio=10 tid=0x000cddc0 nid=0x6 waiting on condition &lt;span class=&quot;error&quot;&gt;&amp;#91;0..0&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&quot;Finalizer&quot; daemon prio=8 tid=0x000c7d68 nid=0x4 in Object.wait() &lt;span class=&quot;error&quot;&gt;&amp;#91;fc77f000..fc77fc30&amp;#93;&lt;/span&gt;&lt;br/&gt;
        at java.lang.Object.wait(Native Method)&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;waiting on &amp;lt;0xf1f437a8&amp;gt; (a java.lang.ref.ReferenceQueue$Lock)&lt;br/&gt;
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)&lt;/li&gt;
	&lt;li&gt;locked &amp;lt;0xf1f437a8&amp;gt; (a java.lang.ref.ReferenceQueue$Lock)&lt;br/&gt;
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)&lt;br/&gt;
        at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&quot;Reference Handler&quot; daemon prio=10 tid=0x000c72e8 nid=0x3 in Object.wait() &lt;span class=&quot;error&quot;&gt;&amp;#91;fe27f000..fe27fc30&amp;#93;&lt;/span&gt;&lt;br/&gt;
        at java.lang.Object.wait(Native Method)&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;waiting on &amp;lt;0xf1f43810&amp;gt; (a java.lang.ref.Reference$Lock)&lt;br/&gt;
        at java.lang.Object.wait(Object.java:429)&lt;br/&gt;
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:115)&lt;/li&gt;
	&lt;li&gt;locked &amp;lt;0xf1f43810&amp;gt; (a java.lang.ref.Reference$Lock)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&quot;main&quot; prio=5 tid=0x000356b8 nid=0x1 in Object.wait() &lt;span class=&quot;error&quot;&gt;&amp;#91;ffbfe000..ffbff164&amp;#93;&lt;/span&gt;&lt;br/&gt;
        at java.lang.Object.wait(Native Method)&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;waiting on &amp;lt;0xf18475f8&amp;gt; (a [I)&lt;br/&gt;
        at java.lang.Object.wait(Object.java:429)&lt;br/&gt;
        at org.apache.commons.net.telnet.TelnetInputStream.read(TelnetInputStream.java:339)&lt;/li&gt;
	&lt;li&gt;locked &amp;lt;0xf18475f8&amp;gt; (a [I)&lt;br/&gt;
        at org.apache.commons.net.telnet.TelnetInputStream.read(TelnetInputStream.java:466)&lt;br/&gt;
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:220)&lt;br/&gt;
        at java.io.BufferedInputStream.read(BufferedInputStream.java:277)&lt;/li&gt;
	&lt;li&gt;locked &amp;lt;0xf1849700&amp;gt; (a java.io.BufferedInputStream)&lt;br/&gt;
        at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:408)&lt;br/&gt;
        at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:450)&lt;br/&gt;
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:182)&lt;/li&gt;
	&lt;li&gt;locked &amp;lt;0xf184a0c0&amp;gt; (a java.io.InputStreamReader)&lt;br/&gt;
        at java.io.InputStreamReader.read(InputStreamReader.java:167)&lt;br/&gt;
        at java.io.BufferedReader.fill(BufferedReader.java:136)&lt;br/&gt;
        at java.io.BufferedReader.readLine(BufferedReader.java:299)&lt;/li&gt;
	&lt;li&gt;locked &amp;lt;0xf184a0c0&amp;gt; (a java.io.InputStreamReader)&lt;br/&gt;
        at java.io.BufferedReader.readLine(BufferedReader.java:362)&lt;br/&gt;
        at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:264)&lt;br/&gt;
        at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:460)&lt;br/&gt;
        at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:520)&lt;br/&gt;
        at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:569)&lt;br/&gt;
        at org.apache.commons.net.ftp.FTP.quit(FTP.java:781)&lt;br/&gt;
        at org.apache.commons.net.ftp.FTPClient.logout(FTPClient.java:706)&lt;br/&gt;
        at com.nokia.ci.nwg.util.ftp.FTPHandler.disconnect(FTPHandler.java:318)&lt;br/&gt;
        at com.nokia.ci.nwg.CDRTransmitter.doPerformControl(CDRTransmitter.java:71)&lt;br/&gt;
        at com.nokia.ci.nwg.CDRProcessor.doProccessCDRs(CDRProcessor.java:59)&lt;br/&gt;
        at com.nokia.ci.nwg.CDRProcessor.main(CDRProcessor.java:85)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&quot;VM Thread&quot; prio=5 tid=0x000c64a0 nid=0x2 runnable&lt;/p&gt;

&lt;p&gt;&quot;VM Periodic Task Thread&quot; prio=10 tid=0x000d0c20 nid=0x8 waiting on condition&lt;br/&gt;
&quot;Suspend Checker Thread&quot; prio=10 tid=0x000cd488 nid=0x5 runnable&lt;/p&gt;</comment>
                </comments>
    
    <issuelinks>
                <issuelinktype id="10030">
            <name>Reference</name>
                            <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="12340554">NET-91</issuekey>
        </issuelink>
                    </outwardlinks>
                                </issuelinktype>
            </issuelinks>
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-141] Add connection timeout support to SocketClient and/or SocketFactory/DefaultSocketFactory</title>
<link>http://issues.apache.org/jira/browse/NET-141</link>

                    <description>Hi,

&lt;p&gt;If executing the following code&lt;br/&gt;
 String hostname = &quot;localhost&quot;;&lt;br/&gt;
 FTPClient client = new FTPClient();&lt;br/&gt;
 client.setDefaultTimeout(1000);&lt;br/&gt;
 client.connect(hostname);&lt;/p&gt;

&lt;p&gt;against a ftp server that ignores the connection attempt (e.g. is firewalled/malfunctoned), there will be no exception after 1000 ms. The exception will be thrown after a default timeout of three minutes. (Three minutes on a debian/ and a suse machines. Might be different on other platforms).&lt;/p&gt;

&lt;p&gt;JavaDoc says:&lt;br/&gt;
public void setDefaultTimeout(int timeout)&lt;br/&gt;
  Set the default timeout in milliseconds to use when opening a socket.&lt;/p&gt;


&lt;p&gt;Digging through the code I found, that DefaultSocketFactory which is used be SocketClient does not care about any value set with this method. It creates a new Socket with Socket(hostname, port) and relies on the VMs behaviour.&lt;/p&gt;

&lt;p&gt;To get this fixed I set a custom SocketFactory with client.setSocketFactory(socketFactory); that uses a timeout for socket connection.&lt;/p&gt;

&lt;p&gt;This bug is also in 1.4.1, but this value is not listed...&lt;/p&gt;


&lt;p&gt;Christian&lt;/p&gt;</description>
                <environment></environment>
            <key id="12350924">NET-141</key>
        <summary>Add connection timeout support to SocketClient and/or SocketFactory/DefaultSocketFactory</summary>
        <type id="4" iconUrl="http://issues.apache.org/jira/images/icons/improvement.gif">Improvement</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="dfs@apache.org">Daniel Savarese</assignee>
            
                        <reporter username="christian.hufgard@gmx.de">Christian Hufgard</reporter>
            
    <created>Mon, 25 Sep 2006 03:09:15 -0700 (PDT)</created>
    <updated>Wed, 19 Sep 2007 22:31:22 -0700 (PDT)</updated>

                        <version>1.4</version>
            
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12437509" author="christian.hufgard@gmx.de" created="Mon, 25 Sep 2006 03:17:58 -0700 (PDT)"  >Simple factory that uses jdk1.4&apos;s feature to create a Socket with a connection timeout.</comment>
                    <comment id="12437585" author="dfs@apache.org" created="Mon, 25 Sep 2006 08:17:48 -0700 (PDT)"  >This is not a bug.  You used the API exactly as intended.  If you want a connect timeout, you need to create a socket factory (this has been explained multiple times on th mailing list).  Commons Net 1.4.1 is JDK 1.3 compatible. Therefore, it cannot support connect timeouts. setDefaultTimeout does exactly what it is supposed to do. It sets the socket timeout (read/write timeout). For a release that supports JDK 1.4 or 1.5 as a baseline, connect timeouts will be added.</comment>
                    <comment id="12437592" author="christian.hufgard@gmx.de" created="Mon, 25 Sep 2006 08:41:48 -0700 (PDT)"  >Thanks for the quick response.

&lt;p&gt;Ok, should have checked the archives before &lt;img class=&quot;emoticon&quot; src=&quot;https://issues.apache.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;. But I think if this is a feature, it should be documented within the API. At least I haven&apos;t found it within FTPClient and SocketClient. DefaultSocketFactory just notices that it wrappes Socket.&lt;/p&gt;

&lt;p&gt;Maybe SocketClient.setDefaultTimeout(int timeout) would be a good place to get this information noticed.&lt;/p&gt;

&lt;p&gt;I still think, this behaviour is a little bit strange. We also use commons-httpclient and there is some code that uses &amp;gt;jdk 1.4 feature if available and implements a custom way for the connect timeout if they are not.&lt;br/&gt;
Think this would be usefull for ftpclient too.&lt;/p&gt;</comment>
                    <comment id="12437865" author="dfs@apache.org" created="Tue, 26 Sep 2006 08:26:38 -0700 (PDT)"  >I&apos;m reclassifying this issue as an improvement slated for the 2.0 release, which is allowed to use JDK 1.4/1.5 features. We&apos;ve got to discuss on commons-dev a bit how best to support connection timeouts. Do we want to add a slew of connect methods to SocketClient that take timeout parameters (this would be nicer if Java supported default argument values)? Or do we want to add a setConnectionTimeout (easier change, but awkward)?

&lt;p&gt;My bias is to add only one or two connect methods that correspond to the two Socket.connect methods that require a SocketAddress argument. This avoids having a ton of different version of connect. Another thing to consider (separate issue) is if we need to deprecate SocketFactory and move to javax.net.SocketFactory and javax.net.ServerSocketFactory. Unfortunately, the javax.net classes are not interfaces, so I don&apos;t think we can abandon SocketFactory. However, as part of this issue, a createSocket() method must be added that creates an unconnected Socket.  We use that to create the socket and then the JDK 1.4 Socket.connect to establish the socket connection with a timeout.&lt;/p&gt;

&lt;p&gt;At any rate, that&apos;s my proposal (two new SocktClient.connect methods and one new SocketFactory/DefaultSocketFactory.createSocket() method) . If Rory, Steve, and company don&apos;t object, I&apos;ll make the change to the 2.0 tree either this weekend or the following weekend.&lt;/p&gt;</comment>
                    <comment id="12455832" author="rwinston@eircom.net" created="Tue, 5 Dec 2006 17:03:42 -0800 (PST)"  >Added in 2.0.</comment>
                </comments>
    
    <attachments>
            <attachment id="12341613" name="CustomSocketFactory.java" size="1580" author="christian.hufgard@gmx.de" created="Mon, 25 Sep 2006 03:17:58 -0700 (PDT)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-140] FTPClient listFiles returns incorrect timestamp on freshly uploaded file but corrects itself after about 15 minutes</title>
<link>http://issues.apache.org/jira/browse/NET-140</link>

                    <description>This is an odd one:

&lt;p&gt;We upload GPS data each hour to a public site using FTPClient. Every 24 hours we check for files older than 60 days using listFiles and getting the timestamps do decide if we want to delete older files.&lt;/p&gt;

&lt;p&gt;When we list the files, the most recently uploaded files have a time stamp exactly one year too old. After about 15 minutes, it seems to correct itself and eventually displays the correct timestamp.&lt;/p&gt;

&lt;p&gt;During this time while FTPFile.getTimestamp is giving the incorrect timestamp, browsing the folder with a web browser, a commercial FTP client, or actually checking the file info in a shell shows the correct timestamp (i.e. does not seem to be a problem on the remote site)&lt;/p&gt;

&lt;p&gt;commons-net-1.4.1 (as well as commons-net-20060901) exhibits this behavior.&lt;/p&gt;

&lt;p&gt;commons-net-1.3.0 works properly&lt;/p&gt;

&lt;p&gt;I did a little investigating, and it seems to happen with every file written to the remote directory each hour, and the incorrect timestamp will be returned using listFiles for about 15 minutes... and then it corrects itself.&lt;/p&gt;</description>
                <environment>Windows local client site, Linux remote server site</environment>
            <key id="12349130">NET-140</key>
        <summary>FTPClient listFiles returns incorrect timestamp on freshly uploaded file but corrects itself after about 15 minutes</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="bgiel">Bill Giel</reporter>
            
    <created>Sat, 2 Sep 2006 13:53:28 -0700 (PDT)</created>
    <updated>Mon, 4 Jun 2007 06:06:15 -0700 (PDT)</updated>

                        <version>1.4</version>
            
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12432307" author="rwinston@eircom.net" created="Sat, 2 Sep 2006 15:00:07 -0700 (PDT)"  >Bill

&lt;p&gt;Would you be able to provide some raw listings of files that exhibit this behaviour? I think this is related to a previous issue regarding date handling and old/new date formats. &lt;/p&gt;</comment>
                    <comment id="12442214" author="bgiel" created="Fri, 13 Oct 2006 19:46:04 -0700 (PDT)"  >
&lt;p&gt;   [[ Old comment, sent by email on Sun, 03 Sep 2006 01:22:07 -0400 ]]&lt;/p&gt;

&lt;p&gt;Thanks for the quick reply, Rory.&lt;/p&gt;

&lt;p&gt;See the attached, which contains a small test source and some results &lt;br/&gt;
for a few different sites. A couple of sites worked well, but a couple &lt;br/&gt;
do not. Unfortunately for me, my public site is one that does not work. &lt;br/&gt;
(But commons-net-1.3.0 works for all, so I&apos;ll be using that for now.)&lt;/p&gt;

&lt;p&gt;Let me know if you need more info, I&apos;ll try my best to get what you need.&lt;/p&gt;

&lt;p&gt;Regards,&lt;/p&gt;

&lt;p&gt;Bill&lt;/p&gt;


&lt;p&gt;&amp;#8211; &lt;br/&gt;
William Giel, LS&lt;br/&gt;
======================&lt;br/&gt;
Rocco V. D&apos;Andrea, Inc.&lt;br/&gt;
PO Box 549 / Six Neil Lane&lt;br/&gt;
Riverside, CT 06460&lt;br/&gt;
203-637-1779 (Voice)&lt;br/&gt;
203-637-1770 (Fax)&lt;br/&gt;
bgiel@rvdi.com&lt;br/&gt;
www.rvdi.com&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;demime 1.01d removed an attachment of type application/x-zip-compressed which had a name of timestamp-issue.zip&amp;#93;&lt;/span&gt;&lt;/p&gt;</comment>
                    <comment id="12442215" author="bgiel" created="Fri, 13 Oct 2006 19:46:04 -0700 (PDT)"  >
&lt;p&gt;   [[ Old comment, sent by email on Sun, 03 Sep 2006 01:29:31 -0400 ]]&lt;/p&gt;

&lt;p&gt;I may not have made it clear, the only machine that corrects itself is &lt;br/&gt;
the Sphera Linux machine. I have a feeling that there is a process &lt;br/&gt;
running there that causes this behavior. The timestamps do not correct &lt;br/&gt;
themselves on the RedHat9 machine.&lt;/p&gt;

&lt;p&gt;Bill&lt;/p&gt;


&lt;p&gt;&amp;#8211; &lt;br/&gt;
William Giel, LS&lt;br/&gt;
======================&lt;br/&gt;
Rocco V. D&apos;Andrea, Inc.&lt;br/&gt;
PO Box 549 / Six Neil Lane&lt;br/&gt;
Riverside, CT 06460&lt;br/&gt;
203-637-1779 (Voice)&lt;br/&gt;
203-637-1770 (Fax)&lt;br/&gt;
bgiel@rvdi.com&lt;br/&gt;
www.rvdi.com&lt;/p&gt;</comment>
                    <comment id="12442216" author="bgiel" created="Fri, 13 Oct 2006 19:46:05 -0700 (PDT)"  >
&lt;p&gt;   [[ Old comment, sent by email on Sun, 03 Sep 2006 16:11:57 -0400 ]]&lt;/p&gt;

&lt;p&gt;Some more info... Sphera VDS Linux mentioned previously, ftpd is version &lt;br/&gt;
wu-2.6.2(1).&lt;/p&gt;

&lt;p&gt;That did not have a problem on the Sun machine, but it does have a &lt;br/&gt;
problem on the Sphera Linux machine.&lt;/p&gt;


&lt;p&gt;&amp;#8211; &lt;br/&gt;
William Giel, LS&lt;br/&gt;
======================&lt;br/&gt;
Rocco V. D&apos;Andrea, Inc.&lt;br/&gt;
PO Box 549 / Six Neil Lane&lt;br/&gt;
Riverside, CT 06460&lt;br/&gt;
203-637-1779 (Voice)&lt;br/&gt;
203-637-1770 (Fax)&lt;br/&gt;
bgiel@rvdi.com&lt;br/&gt;
www.rvdi.com&lt;/p&gt;</comment>
                    <comment id="12500684" author="julien.ayme@gmail.com" created="Fri, 1 Jun 2007 04:47:12 -0700 (PDT)"  >Isn&apos;t this issue related to the issue &amp;lt;a href=&quot;https://issues.apache.org/jira/browse/NET-159&quot;&amp;gt;&lt;a href=&quot;http://issues.apache.org/jira/browse/NET-159&quot; title=&quot;FTPFile.getTimestamp() is off by one year&quot;&gt;&lt;del&gt;NET-159&lt;/del&gt;&lt;/a&gt; &amp;lt;/a&amp;gt; ?</comment>
                    <comment id="12501201" author="rwinston@eircom.net" created="Mon, 4 Jun 2007 06:04:02 -0700 (PDT)"  >The only reason I can see that the timestamp will be out of sync for 15 minutes and then ok is if the FTP server sends  a different timestamp for files that are older than 15 minutes. This will result in the above behaviour. 

&lt;p&gt;I have implemented a workaround for this problem - by calling FTPClient::setDateRollbackPermitted(false), the rollback by 1year should not occur for these situations.&lt;/p&gt;

&lt;p&gt;Any issues, feel free to reopen.&lt;/p&gt;</comment>
                </comments>
    
    <issuelinks>
                <issuelinktype id="10030">
            <name>Reference</name>
                            <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="12368233">NET-159</issuekey>
        </issuelink>
                    </outwardlinks>
                                </issuelinktype>
            </issuelinks>
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-139] Trunk fails to build under JDK 1.6</title>
<link>http://issues.apache.org/jira/browse/NET-139</link>

                    <description>java:compile:&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;echo&amp;#93;&lt;/span&gt; Compiling to /home/hen/apache/jakarta/commons-proper/net/target/classes&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;javac&amp;#93;&lt;/span&gt; Compiling 150 source files to /home/hen/apache/jakarta/commons-proper/net/target/classes&lt;br/&gt;
javac: target release 1.2 conflicts with default source release 1.5</description>
                <environment>JDK 1.6 on Linux</environment>
            <key id="12345628">NET-139</key>
        <summary>Trunk fails to build under JDK 1.6</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="rwinston@eircom.net">Rory Winston</assignee>
            
                        <reporter username="bayard">Henri Yandell</reporter>
            
    <created>Sat, 8 Jul 2006 17:31:38 -0700 (PDT)</created>
    <updated>Wed, 19 Sep 2007 22:31:22 -0700 (PDT)</updated>

                
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                </customfields>
    
</item>

<item>
<title>[NET-73] [net][PATCH] TelnetInputStream.read hangs when socket data ends in a command sequence</title>
<link>http://issues.apache.org/jira/browse/NET-73</link>

                    <description>Background: If one calls TelnetInputStream.read() in single-threaded mode (no &lt;br/&gt;
reader thread) and there is no data immediately available, the call blocks on &lt;br/&gt;
a socket read. When data starts to arrive, the stream adds all the available &lt;br/&gt;
bytes to its internal queue before returning the first one to the caller. To &lt;br/&gt;
do this, it calls __read() in a loop for as long as there are bytes available. &lt;br/&gt;
The __read() method returns the first byte of &quot;user data&quot; from the socket. If &lt;br/&gt;
__read() encounters a Telnet command sequence (IAC, WILL, WONT, DO, DONT, &lt;br/&gt;
etc.), it handles the negotiation transparently and then returns the first &lt;br/&gt;
byte of user data.

&lt;p&gt;In most cases, this works fine, but a problem arises if a chunk of data from &lt;br/&gt;
the remote host ends in a Telnet command sequence. When that happens, the &lt;br/&gt;
TelnetInputStream.read() method hangs, even though it may have already &lt;br/&gt;
acquired some user data. This is because it calls __read() in a loop as long &lt;br/&gt;
as super.available() returns true. But if the remaining data from the socket &lt;br/&gt;
consists entirely of Telnet commands, __read() will process those AND THEN &lt;br/&gt;
BLOCK waiting for user data.&lt;/p&gt;

&lt;p&gt;Just checking super.available() is not sufficient. We should continue the loop &lt;br/&gt;
only if there are bytes of USER DATA still available from the socket. Not &lt;br/&gt;
doing this can cause the client to wait indefinitely.&lt;/p&gt;</description>
                <environment>Operating System: other&lt;br/&gt;
Platform: All</environment>
            <key id="12343039">NET-73</key>
        <summary>[net][PATCH] TelnetInputStream.read hangs when socket data ends in a command sequence</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="rhasselbaum@alumni.ithaca.edu">Rob Hasselbaum</reporter>
            
    <created>Fri, 21 Apr 2006 14:15:58 -0700 (PDT)</created>
    <updated>Tue, 4 Mar 2008 17:20:23 -0800 (PST)</updated>

                
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12411784" author="dfs@apache.org" created="Fri, 21 Apr 2006 17:37:13 -0700 (PDT)"  >Can you submit a patch that corrects the error?  All I can offer you in return&lt;br/&gt;
is our thanks and the addition of your name to the list of contributors.</comment>
                    <comment id="12411785" author="rhasselbaum@alumni.ithaca.edu" created="Fri, 21 Apr 2006 17:40:59 -0700 (PDT)"  >I am working on a patch now. If someone can commit my earlier patch for bug&lt;br/&gt;
38688, we can avoid a messy merge later, as this impacts some of the same code.</comment>
                    <comment id="12411786" author="dfs@apache.org" created="Sun, 23 Apr 2006 17:02:29 -0700 (PDT)"  >Patch for COM-2776 applied.  Thanks!</comment>
                    <comment id="12411787" author="rhasselbaum@alumni.ithaca.edu" created="Mon, 24 Apr 2006 19:41:08 -0700 (PDT)"  >Created an attachment (id=18174)&lt;br/&gt;
Fix read hang after command sequence

&lt;p&gt;This patch prevents the read hang that occurs in single-threaded mode when a&lt;br/&gt;
remote host response ends in a Telnet command sequence.&lt;/p&gt;

&lt;p&gt;I have added a boolean flag to TelnetInputStream.__read that tells it whether&lt;br/&gt;
or not to block on a socket read if there is no user data available in the&lt;br/&gt;
superclass buffer. It is set to true for the first iteration through the loop&lt;br/&gt;
in read(), which is the only time we need to wait. Subsequent iterations only&lt;br/&gt;
serve to eagerly fill the queue, so we don&apos;t need to wait, and the argument is&lt;br/&gt;
set to false. &lt;/p&gt;

&lt;p&gt;If the argument is false and there is no data available, __read() returns a&lt;br/&gt;
value of -2 that prevents the caller from using the data. I didn&apos;t use an&lt;br/&gt;
exception because of overhead concern. (We could hit this condition often.)&lt;/p&gt;

&lt;p&gt;If the reader thread is enabled, run() calls __read() with the argument set to&lt;br/&gt;
true, which is equivalent to the old behavior.&lt;/p&gt;</comment>
                    <comment id="12430756" author="rwinston@eircom.net" created="Sat, 26 Aug 2006 09:38:49 -0700 (PDT)"  >This has been fixed.</comment>
                    <comment id="12575214" author="sebb@apache.org" created="Tue, 4 Mar 2008 17:15:27 -0800 (PST)"  >The fix has been applied to trunk - surely it should also be applied to the NET_2_0 branch before closing this bug?</comment>
                    <comment id="12575215" author="moberhuber" created="Tue, 4 Mar 2008 17:20:23 -0800 (PST)"  >Darn, it seems to be missing on the NET_2_0 branch indeed... and this has been detected before, see &lt;a href=&quot;http://issues.apache.org/jira/browse/NET-179&quot; title=&quot;NET-73    &amp;quot;TelnetInputStream._read() hangs&amp;quot; fix is not included in nightly builds.&quot;&gt;&lt;del&gt;NET-179&lt;/del&gt;&lt;/a&gt; : &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://issues.apache.org/jira/browse/NET-179&quot;&gt;https://issues.apache.org/jira/browse/NET-179&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt; Looks like that one needs to get re-opened?</comment>
                </comments>
    
    <attachments>
            <attachment id="12334120" name="cmd-seq-hang.patch" size="2727" author="rhasselbaum@alumni.ithaca.edu" created="Mon, 24 Apr 2006 19:41:08 -0700 (PDT)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>39377</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-28] [PATCH] [net] patch of FTPS</title>
<link>http://issues.apache.org/jira/browse/NET-28</link>

                    <description>Hi, All.

&lt;p&gt;I have improved and tested some functions of FTPS.&lt;/p&gt;

&lt;p&gt;  DO NOT REPLY &lt;span class=&quot;error&quot;&gt;&amp;#91;COM-2710&amp;#93;&lt;/span&gt;  - &lt;span class=&quot;error&quot;&gt;&amp;#91;net&amp;#93;&lt;/span&gt; How to implent FTPS&lt;br/&gt;
&amp;#12288;&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://marc.theaimsgroup.com/?t=113763609300003&amp;amp;r=1&amp;amp;w=2&quot;&gt;http://marc.theaimsgroup.com/?t=113763609300003&amp;amp;r=1&amp;amp;w=2&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;I attach a patch (src.zip).&lt;/p&gt;

&lt;p&gt;Changes:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;add the implicit mode&lt;/li&gt;
	&lt;li&gt;add the CCC command handling&lt;/li&gt;
	&lt;li&gt;improve a behavior of the PROT command. (C and P)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Sources:&lt;br/&gt;
 FTPSClient.java   &lt;span class=&quot;error&quot;&gt;&amp;#91;modified&amp;#93;&lt;/span&gt;&lt;br/&gt;
 FTPSCommand.java  &lt;span class=&quot;error&quot;&gt;&amp;#91;new&amp;#93;&lt;/span&gt;&lt;br/&gt;
 FTPSReply.java    &lt;span class=&quot;error&quot;&gt;&amp;#91;new&amp;#93;&lt;/span&gt;&lt;/p&gt;


&lt;p&gt;Best Regards.&lt;/p&gt;</description>
                <environment>Operating System: All&lt;br/&gt;
Platform: All</environment>
            <key id="12343002">NET-28</key>
        <summary>[PATCH] [net] patch of FTPS</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="ishigami@victokai.co.jp">Satoshi Ishigami</reporter>
            
    <created>Fri, 31 Mar 2006 10:00:08 -0800 (PST)</created>
    <updated>Wed, 19 Sep 2007 22:31:06 -0700 (PDT)</updated>

                        <version>1.4</version>
            
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12411684" author="ishigami@victokai.co.jp" created="Fri, 31 Mar 2006 10:01:03 -0800 (PST)"  >Created an attachment (id=18009)&lt;br/&gt;
improvement of FTPS</comment>
                    <comment id="12430856" author="rwinston@eircom.net" created="Sun, 27 Aug 2006 06:59:42 -0700 (PDT)"  >This has been applied to a 2.0 branch in SVN.</comment>
                </comments>
    
    <attachments>
            <attachment id="12334095" name="src.zip" size="9558" author="ishigami@victokai.co.jp" created="Fri, 31 Mar 2006 10:01:03 -0800 (PST)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>39166</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-99] [net] MVSFTPEntryParser.java only halfway implemented</title>
<link>http://issues.apache.org/jira/browse/NET-99</link>

                    <description>I have been chasing some bugs when using the ant ftp task, and some problems&lt;br/&gt;
stem from the parsing of the result of the ftp list command.

&lt;p&gt;The file structure of MVS is not a hierarchical filesystem, but it has a&lt;br/&gt;
directory concept known as partition organized datasets. These can be compared&lt;br/&gt;
to a single level directory.&lt;/p&gt;

&lt;p&gt;The current parser does not take these into account.&lt;/p&gt;</description>
                <environment>Operating System: other&lt;br/&gt;
Platform: Other</environment>
            <key id="12342993">NET-99</key>
        <summary>[net] MVSFTPEntryParser.java only halfway implemented</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="henrik.sorensen@balcab.ch">henrik</reporter>
            
    <created>Sun, 26 Mar 2006 21:15:08 -0800 (PST)</created>
    <updated>Wed, 6 Dec 2006 01:45:51 -0800 (PST)</updated>

                
                
                
            <due></due>
    
            <votes>1</votes>
    
                                        

            <comments>
                    <comment id="12411649" author="henrik.sorensen@balcab.ch" created="Sun, 26 Mar 2006 21:16:58 -0800 (PST)"  >Created an attachment (id=17989)&lt;br/&gt;
MVSFTPEntryParser.java replacement

&lt;p&gt;for review, note there is a lot of debug info, and further note, I am not &lt;br/&gt;
really a java programmer but are willing to learn, so just shoot on whatever &lt;br/&gt;
is moving ...&lt;/p&gt;</comment>
                    <comment id="12411650" author="henrik.sorensen@balcab.ch" created="Mon, 27 Mar 2006 05:04:46 -0800 (PST)"  >added &lt;span class=&quot;error&quot;&gt;&amp;#91;net&amp;#93;&lt;/span&gt; to summary, and keyword PatchAvailable</comment>
                    <comment id="12411651" author="scohen@apache.org" created="Tue, 28 Mar 2006 02:22:34 -0800 (PST)"  >You are quite correct.  I remember thinking the same thing when this code was&lt;br/&gt;
submitted.  However, it filled the needs of the original author and was better&lt;br/&gt;
than nothing.  

&lt;p&gt;None of the committers has access to an MVS system or any knowledge of it, as&lt;br/&gt;
you apparently do.  And so, the bottom line is, we humbly request you, in the&lt;br/&gt;
spirit of Open Source, to contribute a fully implemented parser, since you have&lt;br/&gt;
the expertise.  We&apos;ll be happy to commit such a contribution if you submit it,&lt;br/&gt;
and help you get it done if you aren&apos;t familiar with the process.&lt;/p&gt;
</comment>
                    <comment id="12411652" author="henrik.sorensen@balcab.ch" created="Tue, 28 Mar 2006 20:53:13 -0800 (PST)"  >thanks for taking this into consideration.&lt;br/&gt;
I am more than willing to get this committed, so what is the process ?

&lt;p&gt;Must the copyright be assigned to Apache.org, and is so what are the paper work&lt;br/&gt;
needed for this ?&lt;/p&gt;

&lt;p&gt;For the code ...&lt;br/&gt;
Since I do not use the Regex for the file name parsing, which xxxxFtpParserImpl&lt;br/&gt;
should be extended ?&lt;/p&gt;</comment>
                    <comment id="12411653" author="scohen@apache.org" created="Fri, 31 Mar 2006 03:48:09 -0800 (PST)"  >To answer your question, I guess your choices are

&lt;p&gt;1.  Redo your code to use Regular Expressions and inherit from&lt;br/&gt;
ConfigurableFTPFileEntryParserImpl which would be my recommendation.&lt;/p&gt;

&lt;p&gt;2.  If really don&apos;t want to use regex or it&apos;s impossible to write the parser&lt;br/&gt;
this way (i can&apos;t tell from your patch), then you should probably inherit from&lt;br/&gt;
FTPFileEntryParserImpl &lt;/p&gt;

&lt;p&gt;As far as copyright goes, just start with what&apos;s in MVSFTPEntryParser.java.  You&lt;br/&gt;
can change every line of code after that if you like.&lt;/p&gt;

&lt;p&gt;However, it looks like you still have some work to do.  Your code, I see, still&lt;br/&gt;
has TODOs in it.  If you&apos;re going to change the parser implementation, let&apos;s get&lt;br/&gt;
as complete an implementation as you can.  &lt;/p&gt;

&lt;p&gt;Out of curiosity, would you mind also explaining for our benefit what these ZOS&lt;br/&gt;
and PDS things are?  Comments might be a good place to do that.  This OS is much&lt;br/&gt;
different from many of the others we handle.&lt;/p&gt;

&lt;p&gt;Finally, don&apos;t forget the JUnit tests.  Please do not submit your patch until&lt;br/&gt;
all existing tests pass.  And please add more tests that exercise the new&lt;br/&gt;
functionalities you are adding.&lt;/p&gt;
</comment>
                    <comment id="12411654" author="henrik.sorensen@balcab.ch" created="Wed, 5 Apr 2006 19:36:15 -0700 (PDT)"  >this is my current comments in my working version of MVSFTPEntryParser.java. 

&lt;p&gt;try to read it and let know if it is understandable. &lt;/p&gt;

&lt;p&gt;/* &lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Very brief and imcomplete description of the zOS/MVS-filesystem.&lt;/li&gt;
	&lt;li&gt;(Note: &quot;zOS&quot; is the operating system on the mainframe,&lt;/li&gt;
	&lt;li&gt;and is the new name for MVS)&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;The filesystem on the mainframe does not have hierarchal structure as&lt;/li&gt;
	&lt;li&gt;for example the unix filesystem.&lt;/li&gt;
	&lt;li&gt;For a more comprehensive description, please refer to the IBM manuals&lt;/li&gt;
	&lt;li&gt;@LINK:www.ibm....&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;Dataset names&lt;/li&gt;
	&lt;li&gt;=============&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;A dataset name consist of a number of qualifiers separated by &apos;.&apos;,&lt;/li&gt;
	&lt;li&gt;each qualifier can be at most 8 characters, and the total length&lt;/li&gt;
	&lt;li&gt;of a dataset can be max 44 characters including the dots.&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;Dataset organisation&lt;/li&gt;
	&lt;li&gt;====================&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;A dataset represents a piece of storage allocated on one or more disks.&lt;/li&gt;
	&lt;li&gt;The structure of the storage is described with the field dataset&lt;br/&gt;
organinsation (DSORG). &lt;/li&gt;
	&lt;li&gt;There are a number of dataset organisations, but only two are usable for FTP&lt;br/&gt;
transfer. &lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;DSORG:&lt;/li&gt;
	&lt;li&gt;PS: sequential, or flat file&lt;/li&gt;
	&lt;li&gt;PO: partitioned dataset&lt;/li&gt;
	&lt;li&gt;PO-E: extended partitioned dataset&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;The PS file is just a flat file, as you would find it on the unix&lt;/li&gt;
	&lt;li&gt;file system.&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;The PO and PO-E files, can be compared to a single level directory&lt;br/&gt;
structure. &lt;/li&gt;
	&lt;li&gt;A PO file consist of a number of dataset members, or files if you&lt;/li&gt;
	&lt;li&gt;will. It is possible to CD into the file, and to retrieve the&lt;/li&gt;
	&lt;li&gt;individual members.&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;Dataset record format&lt;/li&gt;
	&lt;li&gt;=====================&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;The physical layout of the dataset is described on the dataset itself.&lt;/li&gt;
	&lt;li&gt;There are a number of record formats (RECFM), but just a few is relavant for&lt;/li&gt;
	&lt;li&gt;the FTP transfer.&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;Any one beginning with either F or V can safely used by FTP transfer.&lt;/li&gt;
	&lt;li&gt;All others should only be used with great care.&lt;/li&gt;
	&lt;li&gt;F means a fixed number of records per allocated storage, and V means a&lt;br/&gt;
variable  &lt;/li&gt;
	&lt;li&gt;number of records.&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;Other notes&lt;/li&gt;
	&lt;li&gt;===========&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;The file system supports automatically backup and retrieval of datasets. If&lt;br/&gt;
a &lt;/li&gt;
	&lt;li&gt;file is backed up, the ftp LIST command will return:&lt;/li&gt;
	&lt;li&gt;ARCIVE Not Direct Access Device                KJ.IOP998.ERROR.PL.UNITTEST&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;Implementation notes&lt;/li&gt;
	&lt;li&gt;====================&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;Only datasets that have dsorg PS, PO or PO-E and have recfm&lt;/li&gt;
	&lt;li&gt;beginning with F or V, is fully parsed.&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;The following fields in FTPFile is used:&lt;/li&gt;
	&lt;li&gt;FTPFile.Rawlisting: Always set.&lt;/li&gt;
	&lt;li&gt;FTPFile.Type: DIRECTORY_TYPE or FILE_TYPE or UNKNOWN or null&lt;/li&gt;
	&lt;li&gt;FTPFile.Name: name or null&lt;/li&gt;
	&lt;li&gt;FTPFile.Timestamp: create time or null&lt;/li&gt;
	&lt;li&gt;
&lt;p&gt; */ &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;/* Format of ZOS/MVS file list: &lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;0    1         2      3    4    5      6     7    8     9&lt;/li&gt;
	&lt;li&gt;Volume Unit    Referred Ext Used Recfm Lrecl BlkSz Dsorg Dsname&lt;/li&gt;
	&lt;li&gt;B10142 3390   2006/03/20  2   31  F       80    80  PS  MDI.OKL.WORK&lt;/li&gt;
	&lt;li&gt;ARCIVE Not Direct Access Device                 KJ.IOP998.ERROR.PL.UNITTEST&lt;/li&gt;
	&lt;li&gt;B1N231 3390   2006/03/20  1   15  VB     256 27998  PO   PLU&lt;/li&gt;
	&lt;li&gt;B1N231 3390   2006/03/20  1   15  VB     256 27998  PO-E PLB&lt;/li&gt;
	&lt;li&gt;
&lt;p&gt; */ &lt;br/&gt;
 /* ----------------------------------- &lt;/p&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt; Volume&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; Unit&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;2&amp;#93;&lt;/span&gt; Referred&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;3&amp;#93;&lt;/span&gt; Ext: number of extents&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;4&amp;#93;&lt;/span&gt; Used&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;5&amp;#93;&lt;/span&gt; Recfm: Record format&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;6&amp;#93;&lt;/span&gt; Lrecl: Logical record length&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;7&amp;#93;&lt;/span&gt; BlkSz: Block size&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;8&amp;#93;&lt;/span&gt; Dsorg: Dataset organisation. Many exists but only support: PS, PO, PO-E&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;9&amp;#93;&lt;/span&gt; Dsname: Dataset name&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;Note: When volume is ARCIVE, it means the dataset is stored somewhere in&lt;/li&gt;
	&lt;li&gt;a tape archive. These entries is currently not supported by this&lt;/li&gt;
	&lt;li&gt;parser. A null value is returned.&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;
&lt;p&gt;  */ &lt;br/&gt;
// dsorg last two tokens describe file: &lt;br/&gt;
// &apos;PS&apos;: sequential file &lt;br/&gt;
// &apos;PO&apos;: partioned dataset PDS &lt;br/&gt;
// &apos;PO-E&apos;: PDS Library &lt;br/&gt;
// &apos;  &apos;: unknown, probably archived. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;/* &lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Format of a PDS:&lt;/li&gt;
	&lt;li&gt;0         1        2          3        4     5     6      7    8&lt;/li&gt;
	&lt;li&gt;Name      VV.MM   Created       Changed      Size  Init   Mod   Id&lt;/li&gt;
	&lt;li&gt;TBSHELF   01.03 2002/09/12 2002/10/11 09:37    11    11     0 KIL001&lt;/li&gt;
	&lt;li&gt;TBTOOL    01.12 2002/09/12 2004/11/26 19:54    51    28     0 KIL001&lt;/li&gt;
	&lt;li&gt;
&lt;p&gt; */ &lt;br/&gt;
/* &lt;/p&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt; Name&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; VV.MM: Version . modification&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;2&amp;#93;&lt;/span&gt; Created: yyyy / MM / dd&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;3,4&amp;#93;&lt;/span&gt; Changed: yyyy / MM / dd  HH:mm&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;5&amp;#93;&lt;/span&gt; Size: number of lines&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;6&amp;#93;&lt;/span&gt; Init: number of lines when first created&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;7&amp;#93;&lt;/span&gt; Mod: number of modified lines a last save&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;8&amp;#93;&lt;/span&gt; Id: User id for last update&lt;/li&gt;
	&lt;li&gt;
&lt;p&gt; */ &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</comment>
                    <comment id="12411655" author="henrik.sorensen@balcab.ch" created="Fri, 7 Apr 2006 12:17:43 -0700 (PDT)"  >Created an attachment (id=18038)&lt;br/&gt;
MVSFTPEntryParser.java replacement v2.

&lt;p&gt;this is a much cleaned up version of the MVSFTP parser.&lt;br/&gt;
TODO:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;make it configurable&lt;/li&gt;
	&lt;li&gt;figure out how to report errors&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    <comment id="12411656" author="scohen@apache.org" created="Sat, 8 Apr 2006 17:16:09 -0700 (PDT)"  >Thanks very much for your comments on this OS.  They help me to finally&lt;br/&gt;
understand what it is we are working with here.


&lt;p&gt;OK, here&apos;s what I think we&apos;ll do.  I just noticed upthread your &quot;I am not a java&lt;br/&gt;
programmer&quot; which explains why you&apos;re not using the regex thing, and a few other&lt;br/&gt;
things I&apos;d wondered about that a java programmer might know about but you may&lt;br/&gt;
not.  I wouldn&apos;t expect you to write JUnit tests for example as a non-java&lt;br/&gt;
programmer. &lt;/p&gt;

&lt;p&gt;Let me have a whack at what you have done.  Now that I understand the code, I&lt;br/&gt;
can probably find the best way to fit it into our system.  Then I&apos;ll send it&lt;br/&gt;
back to you for testing, and we&apos;ll work collaboratively.  Does that sound okay&lt;br/&gt;
to you?&lt;/p&gt;</comment>
                    <comment id="12411657" author="scohen@apache.org" created="Sat, 8 Apr 2006 23:44:25 -0700 (PDT)"  >henrik - one thing I notice in your code compared with the previous - in the&lt;br/&gt;
&quot;FILELIST&quot; mode, according to the guy who contributed the previous code, the&lt;br/&gt;
&quot;date&quot; field is a &quot;Date Last Accessed&quot; and therefore not suitable for the&lt;br/&gt;
timestamp field of FTPFile which assumes &quot;Date Modified&quot; semantics (for example&lt;br/&gt;
the FTP tasks of Ant will use this for &quot;newer&quot; comparisons.  Do you know if he&lt;br/&gt;
was right?</comment>
                    <comment id="12411658" author="scohen@apache.org" created="Sun, 9 Apr 2006 21:13:13 -0700 (PDT)"  >Created an attachment (id=18048)&lt;br/&gt;
Candidate replacement 3 - from Steve Cohen

&lt;p&gt;henrik - please have a look at this file.  I believe it does basically the same&lt;br/&gt;
thing as yours albeit in a much different way.	We use&lt;br/&gt;
CompositeFileEntryParser, which delegates to two internal classes, one for the&lt;br/&gt;
&quot;Memberlist&quot; and one for the &quot;FileList&quot;.  Anything else is rejected.  It uses&lt;br/&gt;
regexes, which, once you get over the hump, add clarity to the process.&lt;/p&gt;

&lt;p&gt;I don&apos;t want to commit this until you have had a chance to test it in your&lt;br/&gt;
environment.  Also, this breaks existing JUnit tests which, in my opinion,&lt;br/&gt;
weren&apos;t very robust anyway.  If you understand JUnit, please have a look and&lt;br/&gt;
see what you can do.  If you don&apos;t understand JUnit, could you please attach&lt;br/&gt;
lists of good and bad listings that we can work into a test?&lt;/p&gt;

&lt;p&gt;As per earlier note, this FileList parser doesn&apos;t do anything with the date,&lt;br/&gt;
which I believe has &quot;last access&quot; semantics, not &quot;last modified&quot; semantics,&lt;br/&gt;
which is what we need for the date to be of value.&lt;/p&gt;

&lt;p&gt;Please send me your comments, and thanks for your contributions, without which&lt;br/&gt;
mine would not have been possible.&lt;/p&gt;</comment>
                    <comment id="12411659" author="scohen@apache.org" created="Sun, 9 Apr 2006 22:40:39 -0700 (PDT)"  >Created an attachment (id=18049)&lt;br/&gt;
Candidate replacement 4 - from Steve Cohen

&lt;p&gt;Yet another attachment.  I realized I could do some testing, and the previous&lt;br/&gt;
patch failed.  This one does better.&lt;/p&gt;

&lt;p&gt;henrik - please note that the way you were doing it, and the way my previous&lt;br/&gt;
attachment was doing it violated the agreed-upon semantics of these parsers -&lt;br/&gt;
when an entry cannot be parsed, null must be returned, NOT an FTPFile with only&lt;br/&gt;
the rawListing field filled in.  We had this argument a few years back and&lt;br/&gt;
while neither way is perfect, it was felt that this way had the fewest&lt;br/&gt;
problems.  It is better to be consistent here, than to try to give the caller&lt;br/&gt;
as much information as possible, which will undoubtedly trip someone up&lt;br/&gt;
somewhere.&lt;/p&gt;</comment>
                    <comment id="12411660" author="henrik.sorensen@balcab.ch" created="Sat, 15 Apr 2006 20:08:10 -0700 (PDT)"  >&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;steve,&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;thanks for spring cleaning of my code. I will soon try it, and let you know&lt;br/&gt;
about the results.&lt;br/&gt;
Consider me a complete &apos;junit&apos; illiterate. What do I need to do ?&lt;/p&gt;

&lt;p&gt;Exactly how is the MvsFilelist and MvsMemberlist classes choosen ?&lt;br/&gt;
By trial and error, aka the first parser that does not return null ?&lt;br/&gt;
The problem is that there are at least one more list type beside the two&lt;br/&gt;
mentioned, and more might come.&lt;br/&gt;
The header that is removed in the preparse method is IMO the most reliable way&lt;br/&gt;
to detect which kind of list is coming.&lt;/p&gt;

&lt;p&gt;In the MvsMemberlistFTPEntryParser, you have&lt;br/&gt;
        try&lt;/p&gt;
	        {
	            file.setTimestamp(super.parseTimestamp(datestr));
	        }
&lt;p&gt;	        catch (ParseException e)&lt;/p&gt;
	        {
	        	return null;  // this is a parsing failure too.
	        }
&lt;p&gt;if the date information cannot parse, just set the field to null. There are a&lt;br/&gt;
number of reasons as to why the date cannot parse. It can be blank, or the FTP&lt;br/&gt;
is setup to simply not to return this information.&lt;/p&gt;

&lt;p&gt;Further, in MvsFilelistFTPEntryParser, two comments.&lt;br/&gt;
First the original observation regarding &apos;referred date&apos; is correct. &lt;br/&gt;
It is a shame the referred date is returned by the ftp LIST command, since it is&lt;br/&gt;
pretty useless, at least for FTP, so it should be kept as null.&lt;/p&gt;

&lt;p&gt;Second, in parseFTPEntry, don&apos;t be cheap with the if statements:&lt;br/&gt;
use &lt;br/&gt;
if (&quot;PS&quot;.equals(dsorg)) file.setType(FTPFile.FILE_TYPE);&lt;br/&gt;
else if (&quot;PO&quot;.equals(dsorg) || &quot;PO-E&quot;.equals(dsorg))&lt;br/&gt;
file.setType(FTPFile.DIRECTORY_TYPE);&lt;br/&gt;
else return null;&lt;/p&gt;

&lt;p&gt;it is a matter of style of course, but I doubt this extra if statement costs&lt;br/&gt;
anything.&lt;/p&gt;

&lt;p&gt;Lastly.&lt;br/&gt;
Detection of zOS server&lt;br/&gt;
-----------------------&lt;br/&gt;
Strictly speaking to the check when to use the MVS parser at all, it is not&lt;br/&gt;
enough to check the result of the SYST ftp command. &lt;br/&gt;
Even when the SYST ftp command returns&lt;br/&gt;
&apos;MVS is the operating system of this server. FTP Server is running on z/OS.&apos;&lt;br/&gt;
the server supports two dataset modes.&lt;br/&gt;
The classical unix style and the mentioned zOS filesystem.&lt;br/&gt;
The correct way to check which is active, is to check the first character of the&lt;br/&gt;
PWD ftp command. If it is &quot;/&quot; then use a standard unix parser, and if &quot;&apos;&quot;,&lt;br/&gt;
(single quote) then use the MVS parser. &lt;br/&gt;
I am clueless as to where to put this information, but it could probably be done&lt;br/&gt;
with the getDefaultConfiguration method.&lt;br/&gt;
Btw, I would prefer to change the name MVS to new name zOS, but this is probably&lt;br/&gt;
a larger change. Maybe keep the existing parser using the MVS name and mark it&lt;br/&gt;
deprecated, and create a new class using the ZOS name?&lt;/p&gt;

&lt;p&gt;The null issue&lt;br/&gt;
--------------&lt;br/&gt;
If the convention is to return null for unparsed entries then so be it. But how&lt;br/&gt;
the caller can use this null entry is a mystery to me. At least with the&lt;br/&gt;
rawlisting filled, the caller have some chance of at least providing some hints&lt;br/&gt;
to the expected null-pointer exceptions.&lt;/p&gt;</comment>
                    <comment id="12411661" author="scohen@apache.org" created="Tue, 18 Apr 2006 03:00:21 -0700 (PDT)"  >(In reply to comment #12)

&lt;p&gt;My comments are inline. &lt;/p&gt;

&lt;p&gt;&amp;gt; - steve,&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; thanks for spring cleaning of my code. I will soon try it, and let you know&lt;br/&gt;
&amp;gt; about the results.&lt;br/&gt;
&amp;gt; Consider me a complete &apos;junit&apos; illiterate. What do I need to do ?&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; Exactly how is the MvsFilelist and MvsMemberlist classes choosen ?&lt;br/&gt;
&amp;gt; By trial and error, aka the first parser that does not return null ?&lt;/p&gt;

&lt;p&gt;Yes, that is correct.&lt;/p&gt;

&lt;p&gt;&amp;gt; The problem is that there are at least one more list type beside the two&lt;br/&gt;
&amp;gt; mentioned, and more might come.&lt;/p&gt;

&lt;p&gt;Can we get parsers for those?  Is that what you mean by &quot;might come&quot;?&lt;/p&gt;


&lt;p&gt;&amp;gt; The header that is removed in the preparse method is IMO the most reliable way&lt;br/&gt;
&amp;gt; to detect which kind of list is coming.&lt;/p&gt;

&lt;p&gt;You may be right.  I thought about that and thought that this way was most&lt;br/&gt;
faithful to the &quot;Composite&quot; parser concept, but I haven&apos;t really made a final&lt;br/&gt;
decision on that yet.  &lt;/p&gt;


&lt;p&gt;&amp;gt; &lt;br/&gt;
&amp;gt; In the MvsMemberlistFTPEntryParser, you have&lt;br/&gt;
&amp;gt;         try&lt;br/&gt;
&amp;gt; 	        {
&amp;gt; 	            file.setTimestamp(super.parseTimestamp(datestr));
&amp;gt; 	        }&lt;br/&gt;
&amp;gt; 	        catch (ParseException e)&lt;br/&gt;
&amp;gt; 	        {
&amp;gt; 	        	return null;  // this is a parsing failure too.
&amp;gt; 	        }&lt;br/&gt;
&amp;gt; if the date information cannot parse, just set the field to null. There are a&lt;br/&gt;
&amp;gt; number of reasons as to why the date cannot parse. It can be blank, or the FTP&lt;br/&gt;
&amp;gt; is setup to simply not to return this information.&lt;/p&gt;

&lt;p&gt;Why would the date SOMETIMES be blank.  A system like that violates the usual&lt;br/&gt;
assumptions that these systems behave in a deterministic way.  (I can understand&lt;br/&gt;
if it&apos;s a switch that is sometimes turned off.  In your experience, is that very&lt;br/&gt;
common?)&lt;/p&gt;

&lt;p&gt;&amp;gt; &lt;br/&gt;
&amp;gt; Further, in MvsFilelistFTPEntryParser, two comments.&lt;br/&gt;
&amp;gt; First the original observation regarding &apos;referred date&apos; is correct. &lt;br/&gt;
&amp;gt; It is a shame the referred date is returned by the ftp LIST command, since it is&lt;br/&gt;
&amp;gt; pretty useless, at least for FTP, so it should be kept as null.&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; Second, in parseFTPEntry, don&apos;t be cheap with the if statements:&lt;br/&gt;
&amp;gt; use &lt;br/&gt;
&amp;gt; if (&quot;PS&quot;.equals(dsorg)) file.setType(FTPFile.FILE_TYPE);&lt;br/&gt;
&amp;gt; else if (&quot;PO&quot;.equals(dsorg) || &quot;PO-E&quot;.equals(dsorg))&lt;br/&gt;
&amp;gt; file.setType(FTPFile.DIRECTORY_TYPE);&lt;br/&gt;
&amp;gt; else return null;&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; it is a matter of style of course, but I doubt this extra if statement costs&lt;br/&gt;
&amp;gt; anything.&lt;/p&gt;

&lt;p&gt;You&apos;re right.&lt;/p&gt;

&lt;p&gt;&amp;gt; &lt;br/&gt;
&amp;gt; Lastly.&lt;br/&gt;
&amp;gt; Detection of zOS server&lt;br/&gt;
&amp;gt; -----------------------&lt;br/&gt;
&amp;gt; Strictly speaking to the check when to use the MVS parser at all, it is not&lt;br/&gt;
&amp;gt; enough to check the result of the SYST ftp command. &lt;br/&gt;
&amp;gt; Even when the SYST ftp command returns&lt;br/&gt;
&amp;gt; &apos;MVS is the operating system of this server. FTP Server is running on z/OS.&apos;&lt;br/&gt;
&amp;gt; the server supports two dataset modes.&lt;br/&gt;
&amp;gt; The classical unix style and the mentioned zOS filesystem.&lt;br/&gt;
&amp;gt; The correct way to check which is active, is to check the first character of the&lt;br/&gt;
&amp;gt; PWD ftp command. If it is &quot;/&quot; then use a standard unix parser, and if &quot;&apos;&quot;,&lt;br/&gt;
&amp;gt; (single quote) then use the MVS parser. &lt;/p&gt;

&lt;p&gt;This sounds like useful information.  We could extend the composite pattern and&lt;br/&gt;
put a UNIX parser into the list.  This is more like the original uses of the&lt;br/&gt;
Composite parser, in which Windows fTP servers are sometimes set up to list in&lt;br/&gt;
unix format.&lt;/p&gt;

&lt;p&gt;&amp;gt; I am clueless as to where to put this information, but it could probably be done&lt;br/&gt;
&amp;gt; with the getDefaultConfiguration method.&lt;br/&gt;
&amp;gt; Btw, I would prefer to change the name MVS to new name zOS, but this is probably&lt;br/&gt;
&amp;gt; a larger change. Maybe keep the existing parser using the MVS name and mark it&lt;br/&gt;
&amp;gt; deprecated, and create a new class using the ZOS name?&lt;/p&gt;

&lt;p&gt;That is a possibility.&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; The null issue&lt;br/&gt;
&amp;gt; --------------&lt;br/&gt;
&amp;gt; If the convention is to return null for unparsed entries then so be it. But how&lt;br/&gt;
&amp;gt; the caller can use this null entry is a mystery to me. At least with the&lt;br/&gt;
&amp;gt; rawlisting filled, the caller have some chance of at least providing some hints&lt;br/&gt;
&amp;gt; to the expected null-pointer exceptions.&lt;br/&gt;
&amp;gt; &lt;/p&gt;
</comment>
                    <comment id="12411662" author="henrik.sorensen@balcab.ch" created="Fri, 21 Apr 2006 18:34:59 -0700 (PDT)"  >Created an attachment (id=18148)&lt;br/&gt;
Candidate replacement 5 - from Henrik Sorensen

&lt;p&gt;Using the regex from the candidate repl 4, I have a version that now works, and&lt;br/&gt;
which also supports the unix file as well.&lt;/p&gt;

&lt;p&gt;I choose to use preParse to detect which type of list is comming.&lt;/p&gt;

&lt;p&gt;The problem with candiate 4, was the two REGEX is actually not mutually&lt;br/&gt;
exclusive.&lt;/p&gt;

&lt;p&gt;I had to add a new method to RegexFTPEntryParserImpl:&lt;br/&gt;
    public boolean changeRegex(String regex)&lt;br/&gt;
    {&lt;br/&gt;
	try&lt;/p&gt;
	{
	    _matcher_ = new Perl5Matcher();
	    pattern   = new Perl5Compiler().compile(regex);
	}
&lt;p&gt;	catch (MalformedPatternException e)&lt;/p&gt;
	{
	    throw new IllegalArgumentException (
	       &quot;Unparseable regex supplied:  &quot; + regex);
	}

&lt;p&gt;	return pattern!=null;&lt;br/&gt;
    }&lt;/p&gt;

&lt;p&gt;and invoke the method from the constructor:&lt;br/&gt;
    public RegexFTPFileEntryParserImpl(String regex)&lt;/p&gt;
    {
	super();
	changeRegex(regex);
    }

&lt;p&gt;Looking forward to your comments.&lt;/p&gt;</comment>
                    <comment id="12411663" author="henrik.sorensen@balcab.ch" created="Fri, 21 Apr 2006 18:49:59 -0700 (PDT)"  >(In reply to comment #13)&lt;br/&gt;
&amp;gt; (In reply to comment #12)&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; My comments are inline. &lt;br/&gt;
mine too&lt;br/&gt;
&amp;gt; &amp;gt; Exactly how is the MvsFilelist and MvsMemberlist classes choosen ?&lt;br/&gt;
&amp;gt; &amp;gt; By trial and error, aka the first parser that does not return null ?&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; Yes, that is correct.&lt;br/&gt;
but I cannot see how this can possible work.&lt;br/&gt;
If for example the first entry on the file list is one of the unsupported types,&lt;br/&gt;
the MvsFilelist parser returns null, and the MvsMemberlist is invoked?!?&lt;br/&gt;
I have uploaded a candidate replacement 5, that uses preparse to detect which&lt;br/&gt;
list is coming.&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; &amp;gt; The problem is that there are at least one more list type beside the two&lt;br/&gt;
&amp;gt; &amp;gt; mentioned, and more might come.&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; Can we get parsers for those?  &lt;br/&gt;
well, the datasets are not relevant for FTP transfer, so I think not.

&lt;p&gt;&amp;gt;Is that what you mean by &quot;might come&quot;?&lt;br/&gt;
well IBM is still developing the mainframe, and a new version is just around the&lt;br/&gt;
corner&lt;img class=&quot;emoticon&quot; src=&quot;https://issues.apache.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;br/&gt;
&amp;gt; &amp;gt; &lt;br/&gt;
&amp;gt; &amp;gt; In the MvsMemberlistFTPEntryParser, you have&lt;br/&gt;
...&lt;br/&gt;
&amp;gt; &amp;gt; number of reasons as to why the date cannot parse. It can be blank, or the FTP&lt;br/&gt;
&amp;gt; &amp;gt; is setup to simply not to return this information.&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; Why would the date SOMETIMES be blank.  &lt;br/&gt;
sometimes blank for the same member means always blank for this member.&lt;br/&gt;
Why it is like this is a longer story, but the short version is that it is&lt;br/&gt;
possible to created the member without any other information than the member name.&lt;/p&gt;

&lt;p&gt;&amp;gt; A system like that violates the usual&lt;br/&gt;
&amp;gt; assumptions that these systems behave in a deterministic way.  (I can understand&lt;br/&gt;
&amp;gt; if it&apos;s a switch that is sometimes turned off.  In your experience, is that very&lt;br/&gt;
&amp;gt; common?)&lt;br/&gt;
not very common, but still possible.&lt;/p&gt;

&lt;p&gt;&amp;gt; &amp;gt; The null issue&lt;br/&gt;
&amp;gt; &amp;gt; --------------&lt;br/&gt;
&amp;gt; &amp;gt; If the convention is to return null for unparsed entries then so be it. But how&lt;br/&gt;
&amp;gt; &amp;gt; the caller can use this null entry is a mystery to me. &lt;br/&gt;
you didn&apos;t comment on this.&lt;/p&gt;

&lt;p&gt;In the ant FTP.java in package org.apache.tools.ant.taskdefs.optional.net, does&lt;br/&gt;
not handle the null entries at all. I have a fix working by me, that I will try&lt;br/&gt;
to push to the ant guys.&lt;/p&gt;
</comment>
                    <comment id="12411664" author="henrik.sorensen@balcab.ch" created="Wed, 26 Apr 2006 21:02:29 -0700 (PDT)"  >It seems these two bugs will be solved with the suggested replacement as well

&lt;p&gt;ASF Bugzilla COM-2341&lt;br/&gt;
ASF Bugzilla COM-2338&lt;/p&gt;

&lt;p&gt;except the unix regex must to extended with an &apos;e&apos; link type.&lt;/p&gt;</comment>
                    <comment id="12431040" author="henrik" created="Mon, 28 Aug 2006 12:28:15 -0700 (PDT)"  >Latest version of the MVS Ftp parser.&lt;br/&gt;
This version supports parsing of the following dataset organisations:&lt;br/&gt;
PS: sequential files&lt;br/&gt;
PO: partitioned files (single level direcory)&lt;br/&gt;
PO-E:partitioned files (single level direcory)

&lt;p&gt;and the following record formats beginning with&lt;br/&gt;
V: Variable length records&lt;br/&gt;
F: Fixed length records&lt;/p&gt;

&lt;p&gt;The files system is described in details within the source code.&lt;/p&gt;

&lt;p&gt;Further a parser for the JES subsystem level one has been added. (JES: Job entry Subsystem (scheduler))&lt;/p&gt;</comment>
                    <comment id="12431682" author="henrik" created="Wed, 30 Aug 2006 13:42:32 -0700 (PDT)"  >With these two changes the JUNIT tests now completes.&lt;br/&gt;
I had to hack a bit in the FTPParseTestFramework.java, to make it work with multiple good samples testsets.</comment>
                    <comment id="12432122" author="henrik" created="Fri, 1 Sep 2006 04:33:30 -0700 (PDT)"  >The MVSFTPEntryParser now supports JES Interface Level 1 and 2.&lt;br/&gt;
The JUNIT test cases have been updated accordingly.

&lt;p&gt;Have fun&lt;br/&gt;
Henrik&lt;/p&gt;</comment>
                    <comment id="12455946" author="rwinston@eircom.net" created="Wed, 6 Dec 2006 01:45:51 -0800 (PST)"  >Fixed in 2.0</comment>
                </comments>
    
    <attachments>
            <attachment id="12340032" name="FTPParseTestFramework.java" size="4913" author="henrik" created="Fri, 1 Sep 2006 04:33:30 -0700 (PDT)" />
            <attachment id="12339899" name="FTPParseTestFramework.java" size="4754" author="henrik" created="Wed, 30 Aug 2006 13:42:32 -0700 (PDT)" />
            <attachment id="12340033" name="MVSFTPEntryParser.java" size="20299" author="henrik" created="Fri, 1 Sep 2006 04:33:30 -0700 (PDT)" />
            <attachment id="12339712" name="MVSFTPEntryParser.java" size="18823" author="henrik" created="Mon, 28 Aug 2006 12:28:15 -0700 (PDT)" />
            <attachment id="12334085" name="MVSFTPEntryParser.java" size="13231" author="henrik.sorensen@balcab.ch" created="Fri, 21 Apr 2006 18:34:59 -0700 (PDT)" />
            <attachment id="12334084" name="MVSFTPEntryParser.java" size="9108" author="scohen@apache.org" created="Sun, 9 Apr 2006 22:40:39 -0700 (PDT)" />
            <attachment id="12334083" name="MVSFTPEntryParser.java" size="9718" author="scohen@apache.org" created="Sun, 9 Apr 2006 21:13:13 -0700 (PDT)" />
            <attachment id="12334082" name="MVSFTPEntryParser.java" size="14140" author="henrik.sorensen@balcab.ch" created="Fri, 7 Apr 2006 12:17:43 -0700 (PDT)" />
            <attachment id="12334081" name="MVSFTPEntryParser.java" size="7393" author="henrik.sorensen@balcab.ch" created="Sun, 26 Mar 2006 21:16:58 -0800 (PST)" />
            <attachment id="12340034" name="MVSFTPEntryParserTest.java" size="8107" author="henrik" created="Fri, 1 Sep 2006 04:33:30 -0700 (PDT)" />
            <attachment id="12339900" name="MVSFTPEntryParserTest.java" size="6325" author="henrik" created="Wed, 30 Aug 2006 13:42:32 -0700 (PDT)" />
            <attachment id="12339713" name="RegexFTPFileEntryParserImpl.java" size="4850" author="henrik" created="Mon, 28 Aug 2006 12:28:15 -0700 (PDT)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>39109</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-65] [net] program hangs while trying to delete a file on a remote FTP Server after downloading same</title>
<link>http://issues.apache.org/jira/browse/NET-65</link>

                    <description>I am using the commons-net-1.1.0.jar to perform FTP related activities. The &lt;br/&gt;
process I am doing is as follows:

&lt;p&gt;1. Logon to the remote FTP Server running on Solaris (which is behind a &lt;br/&gt;
firewall)&lt;br/&gt;
2. Download a file&lt;br/&gt;
3. Delete the remote file after successful download&lt;/p&gt;

&lt;p&gt;But here I am facing a problem, once the file is downloaded, it does not get &lt;br/&gt;
deleted in the remote FTP server and the program hangs. An interrupted IO &lt;br/&gt;
Exception is being thrown and the program just hangs. &lt;/p&gt;

&lt;p&gt;Any suggestions will be appreciated&lt;/p&gt;</description>
                <environment>Operating System: other&lt;br/&gt;
Platform: Other</environment>
            <key id="12342933">NET-65</key>
        <summary>[net] program hangs while trying to delete a file on a remote FTP Server after downloading same</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="m_siddu@yahoo.com">Siddique</reporter>
            
    <created>Tue, 21 Feb 2006 10:12:38 -0800 (PST)</created>
    <updated>Wed, 20 Dec 2006 02:56:02 -0800 (PST)</updated>

                        <version>1.1</version>
            
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12411493" author="dfs@apache.org" created="Wed, 22 Feb 2006 19:28:57 -0800 (PST)"  >Please provide sample code (i.e., a complete working example with a main() that&lt;br/&gt;
can be compiled and executed) that reproduces the problem.  It sounds like&lt;br/&gt;
you&apos;re using retrieveFileStream without calling completePendingCommand. &lt;br/&gt;
However, assuming the issue is not caused by a misuse of the API, before&lt;br/&gt;
investigating further, please upgrade to the latest version of commons-net so we&lt;br/&gt;
do not spend time hunting a problem that has already been fixed.</comment>
                    <comment id="12411494" author="m_siddu@yahoo.com" created="Thu, 23 Feb 2006 05:43:36 -0800 (PST)"  >(In reply to comment #1)&lt;br/&gt;
&amp;gt; Please provide sample code (i.e., a complete working example with a main() &lt;br/&gt;
that&lt;br/&gt;
&amp;gt; can be compiled and executed) that reproduces the problem.  It sounds like&lt;br/&gt;
&amp;gt; you&apos;re using retrieveFileStream without calling completePendingCommand. &lt;br/&gt;
&amp;gt; However, assuming the issue is not caused by a misuse of the API, before&lt;br/&gt;
&amp;gt; investigating further, please upgrade to the latest version of commons-net so &lt;br/&gt;
we&lt;br/&gt;
&amp;gt; do not spend time hunting a problem that has already been fixed.


&lt;p&gt;Well, I have managed to identify the point at which the InterruptedIOException &lt;br/&gt;
is thrown. This occurs in the run() method of the TelnetInputStream class, &lt;br/&gt;
which inturn calls the __read() method. It appears that for some reason when &lt;br/&gt;
there is no response from the remote FTP Server (on Solaris), the thread dies &lt;br/&gt;
and the program just hangs. I have had a look at the latest commons-net, the &lt;br/&gt;
only change I see in that a new runtime exception has been caught. Not sure if &lt;br/&gt;
this will suffice the problem. Do let me know if there is any workaround for &lt;br/&gt;
this problem.&lt;/p&gt;
</comment>
                    <comment id="12411495" author="dfs@apache.org" created="Thu, 23 Feb 2006 20:31:47 -0800 (PST)"  >Without a sample that reproduces the problem there is no way to investigate&lt;br/&gt;
further.  All I can suggest is to try Bruno D&apos;Avanzo&apos;s setReaderThread(false).&lt;br/&gt;
&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://jakarta.apache.org/commons/net/api/org/apache/commons/net/telnet/TelnetClient.html#setReaderThread(boolean&quot;&gt;http://jakarta.apache.org/commons/net/api/org/apache/commons/net/telnet/TelnetClient.html#setReaderThread(boolean&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;)&lt;br/&gt;
I have no idea if it is related to the situation or not because I cannot&lt;br/&gt;
reproduce the problem.</comment>
                    <comment id="12411496" author="m_siddu@yahoo.com" created="Thu, 2 Mar 2006 10:35:09 -0800 (PST)"  >I am getting a SocketTimeoutException in the run method of the &lt;br/&gt;
TelnetInputStream class. I have set socket timeout to 30000, but when I &lt;br/&gt;
increased it to 120000, I did not the exception. Any suggestions in this regard?</comment>
                    <comment id="12459893" author="rwinston@eircom.net" created="Wed, 20 Dec 2006 02:56:02 -0800 (PST)"  >This is also related to the TelnetClient threading issue, which is fixed in 2.0.</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>38730</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-3] [net][PATCH] TelnetInputStream.read sometimes hangs if reader thread is disabled</title>
<link>http://issues.apache.org/jira/browse/NET-3</link>

                    <description>I&apos;m trying to use TelnetClient with the reader thread disabled because I don&apos;t &lt;br/&gt;
want socket timeouts to fire during planned periods of inactivity (COM-1554).

&lt;p&gt;But when the thread is disabled, I&apos;m finding that TelnetInputStream.read &lt;br/&gt;
occassionally hangs when I try to read output from the server.&lt;br/&gt;
The problem appears to be the first while loop in __processChar, which looks &lt;br/&gt;
like this:&lt;/p&gt;

&lt;p&gt;synchronized (__queue)&lt;br/&gt;
{&lt;br/&gt;
  while (__bytesAvailable &amp;gt;= __queue.length - 1)&lt;br/&gt;
  {&lt;br/&gt;
    if(__threaded)&lt;br/&gt;
    {&lt;br/&gt;
      __queue.notify();&lt;br/&gt;
      try&lt;/p&gt;
      {
        __queue.wait();
      }
&lt;p&gt;      catch (InterruptedException e)&lt;/p&gt;
      {
        throw e;
      }
&lt;p&gt;    }&lt;br/&gt;
  ...&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;If you get into this loop and the threaded flag is false, you are stuck &lt;br/&gt;
forever. That&apos;s what&apos;s happening in my case. If I suspend the thread, I can &lt;br/&gt;
see that (_&lt;em&gt;bytesAvailable) is 2048 and (&lt;/em&gt;_queue.length -&lt;br/&gt;
1) is also 2048, so it&apos;s an infinite loop.&lt;/p&gt;

&lt;p&gt;I&apos;m not sure what triggers this, but it seems to happen most often when there &lt;br/&gt;
is a pause in server output or a pause before I initiate the next read.&lt;/p&gt;</description>
                <environment>Operating System: Windows XP&lt;br/&gt;
Platform: PC</environment>
            <key id="12342928">NET-3</key>
        <summary>[net][PATCH] TelnetInputStream.read sometimes hangs if reader thread is disabled</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="rhasselbaum@alumni.ithaca.edu">Rob Hasselbaum</reporter>
            
    <created>Thu, 16 Feb 2006 23:47:23 -0800 (PST)</created>
    <updated>Wed, 19 Sep 2007 22:24:32 -0700 (PDT)</updated>

                
                
                
            <due></due>
    
            <votes>2</votes>
    
                                        

            <comments>
                    <comment id="12411478" author="rhasselbaum@alumni.ithaca.edu" created="Fri, 17 Feb 2006 15:52:29 -0800 (PST)"  >Note that the code snippet in the description is missing the closing brace of &lt;br/&gt;
the &quot;while&quot; loop. It occurs right after the &quot;if(__threaded)&quot; block.</comment>
                    <comment id="12411479" author="dfs@apache.org" created="Thu, 23 Feb 2006 20:44:48 -0800 (PST)"  >I tried adding Bruno D&apos;Avanzo to the cc list unsuccessfully as this appears to&lt;br/&gt;
be related to code he wrote and he may know better why it&apos;s written the way it&lt;br/&gt;
is. He may have gone inactive.  I&apos;ll try to find his non-apache.org email&lt;br/&gt;
address. Unfortunately, I don&apos;t have enough spare cycles right now to&lt;br/&gt;
investigate this &lt;img class=&quot;emoticon&quot; src=&quot;https://issues.apache.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;</comment>
                    <comment id="12411480" author="m_siddu@yahoo.com" created="Thu, 2 Mar 2006 10:48:53 -0800 (PST)"  >I too have experienced the same problem... any solutions for this?</comment>
                    <comment id="12411481" author="rhasselbaum@alumni.ithaca.edu" created="Mon, 6 Mar 2006 19:12:31 -0800 (PST)"  >Does anyone have knowledge of this code?

&lt;p&gt;I am willing to put time into a patch, but the documentation for the class is &lt;br/&gt;
VERY sparse. I&apos;m afraid I&apos;ll just end up breaking it more.&lt;/p&gt;</comment>
                    <comment id="12411482" author="rhasselbaum@alumni.ithaca.edu" created="Wed, 15 Mar 2006 22:17:34 -0800 (PST)"  >Created an attachment (id=17905)&lt;br/&gt;
Proposed patch for hanging read bug</comment>
                    <comment id="12411483" author="rhasselbaum@alumni.ithaca.edu" created="Wed, 15 Mar 2006 22:44:38 -0800 (PST)"  >I believe what&apos;s happening is the buffer (queue) fills up and there is still&lt;br/&gt;
more data to be read from the socket. When this happens in threaded mode, the&lt;br/&gt;
reader thread waits in __processChar, giving the consumer thread a chance to&lt;br/&gt;
drain the buffer. That seems to work fine.

&lt;p&gt;When threaded mode is disabled, however, we need to stop collecting data from&lt;br/&gt;
the socket and return some of what we have so far to the caller. In other words,&lt;br/&gt;
we shouldn&apos;t read any more from the socket or call __processChar unless there is&lt;br/&gt;
still room left in the queue to hold new data.&lt;/p&gt;

&lt;p&gt;I&apos;ve submitted a patch that I think fixes the problem. But since I&apos;m unfamiliar&lt;br/&gt;
with this code (and this is my first Commons contribution), please take a close&lt;br/&gt;
look! &lt;/p&gt;

&lt;p&gt;Basically, what I&apos;ve done is add a check in read() to the while loop that was&lt;br/&gt;
adding data to the queue for non-threaded mode. If the queue is full, the loop&lt;br/&gt;
will terminate now. I also added a safety check to the code in __processChar&lt;br/&gt;
that will throw an IllegalStateException if it is called in non-threaded mode&lt;br/&gt;
and the queue is full. That should never happen.&lt;/p&gt;

&lt;p&gt;All unit tests pass, and the new code prevented hangs in my ad hoc tests. I&lt;br/&gt;
tested it by submitting a command via Telnet to a host that causes it to respond&lt;br/&gt;
with a lot of data (e.g. &quot;cat somebigtextfile.txt&quot;). Then I put the client&lt;br/&gt;
thread to sleep for a few seconds before trying to read any of the response.&lt;br/&gt;
This consistently caused a hang with the old code, but not with the patch.&lt;/p&gt;</comment>
                    <comment id="12411484" author="dfs@apache.org" created="Sun, 23 Apr 2006 16:59:06 -0700 (PDT)"  >Applied patch.  Thanks Rob.</comment>
                    <comment id="12526756" author="moberhuber" created="Wed, 12 Sep 2007 05:07:09 -0700 (PDT)"  >It looks like this patch has been applied for an &quot;1.4.x&quot; version of Commons Net,&lt;br/&gt;
but I cannot find such a released version anywhere.

&lt;p&gt;How can I get a version of Commons Net that&apos;s compatible with 1.4.1 but has the patch?&lt;br/&gt;
Are there any plans for releasing 1.4.2 or 1.5?&lt;br/&gt;
FYI, at Eclipse DSDP-TM (&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://www.eclipse.org/dsdp/tm&quot;&gt;http://www.eclipse.org/dsdp/tm&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;) we&apos;re tracking this as&lt;br/&gt;
&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://bugs.eclipse.org/bugs/show_bug.cgi?id=202758&quot;&gt;https://bugs.eclipse.org/bugs/show_bug.cgi?id=202758&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;</comment>
                    <comment id="12528956" author="erabe" created="Wed, 19 Sep 2007 17:20:02 -0700 (PDT)"  >It also appears to be possible to run into this bug in threaded mode.  It is possible for the close method to set the threaded state to false while the reader is still active.  Under these circumstances the same infinite loop is invoked.  I am also curious when the next build will be happening so I can see if the patch fixes this situation as well.</comment>
                    <comment id="12528978" author="rwinston@eircom.net" created="Wed, 19 Sep 2007 22:11:07 -0700 (PDT)"  >You can try the prerelease at

&lt;p&gt;&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://people.apache.org/~rwinston/commons-net-2.0/&quot;&gt;http://people.apache.org/~rwinston/commons-net-2.0/&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;</comment>
                    <comment id="12528979" author="bayard" created="Wed, 19 Sep 2007 22:24:32 -0700 (PDT)"  >Reclosing so it gets marked as Fixed. Jira migration bug.</comment>
                </comments>
    
    <attachments>
            <attachment id="12334036" name="hanging_read_fix.patch" size="1741" author="rhasselbaum@alumni.ithaca.edu" created="Wed, 15 Mar 2006 22:17:34 -0800 (PST)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>38688</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-16] [net] UnixFTPEntryParser fails to parse Cygwin proftpd output when group names contain spaces</title>
<link>http://issues.apache.org/jira/browse/NET-16</link>

                    <description>Running proftpd under Cygwin on Windows XP reports itself as UNIX-type server&lt;br/&gt;
using the &quot;system&quot; command:

&lt;p&gt;ftp&amp;gt; system&lt;br/&gt;
215 UNIX Type: L8&lt;/p&gt;

&lt;p&gt;Unfortunately Windows allows spaces in group names, so UnixFTPEntryParser fails&lt;br/&gt;
to parse directory output like the following:&lt;/p&gt;

&lt;p&gt;ftp&amp;gt; dir&lt;br/&gt;
200 PORT command successful&lt;br/&gt;
150 Opening ASCII mode data connection for file list&lt;br/&gt;
&lt;del&gt;rw-r&lt;/del&gt;&lt;del&gt;r&lt;/del&gt;-   1 dkilzer  Domain Users        0 Feb 13 17:20 foo.001&lt;br/&gt;
&lt;del&gt;rw-r&lt;/del&gt;&lt;del&gt;r&lt;/del&gt;-   1 dkilzer  Domain Users        0 Feb 13 17:35 foo.002&lt;br/&gt;
226 Transfer complete.&lt;/p&gt;

&lt;p&gt;The expected behavior is that it will find two files listed.&lt;/p&gt;

&lt;p&gt;The actual behavior is that it reports no files in the directory.&lt;/p&gt;</description>
                <environment>Operating System: Windows XP&lt;br/&gt;
Platform: PC</environment>
            <key id="12342907">NET-16</key>
        <summary>[net] UnixFTPEntryParser fails to parse Cygwin proftpd output when group names contain spaces</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="ddkilzer@kilzer.net">David D. Kilzer</reporter>
            
    <created>Mon, 13 Feb 2006 18:47:28 -0800 (PST)</created>
    <updated>Wed, 19 Sep 2007 22:31:04 -0700 (PDT)</updated>

                
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12411420" author="ddkilzer@kilzer.net" created="Mon, 13 Feb 2006 18:48:28 -0800 (PST)"  >Note that this issue was found on commons-net-1.4.1.</comment>
                    <comment id="12411421" author="ddkilzer@kilzer.net" created="Mon, 13 Feb 2006 19:02:27 -0800 (PST)"  >Created an attachment (id=17679)&lt;br/&gt;
Patch v1

&lt;p&gt;This patch fixes the parsing issue for me with proftpd on Cygwin.  The group&lt;br/&gt;
name is recognized as &quot;Domain Users&quot; and all other fields appear to be&lt;br/&gt;
populated correctly.&lt;/p&gt;</comment>
                    <comment id="12411422" author="scohen@apache.org" created="Tue, 14 Feb 2006 03:15:01 -0800 (PST)"  >Thanks, that&apos;s a good patch.  I had my doubts it would pass the JUnit tests, but&lt;br/&gt;
except for a test that specifically disallowed spaces in group names (which I&lt;br/&gt;
can no longer see a good reason for), it passes all existing tests plus a couple&lt;br/&gt;
more I ginned up.  I will commit this soon.</comment>
                    <comment id="12411423" author="scohen@apache.org" created="Tue, 14 Feb 2006 13:01:24 -0800 (PST)"  >Code committed.</comment>
                </comments>
    
    <attachments>
            <attachment id="12334026" name="commons-net-1.4.1-fix-unix-parser-for-cygwin-proftpd.diff" size="652" author="ddkilzer@kilzer.net" created="Mon, 13 Feb 2006 19:02:27 -0800 (PST)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>38634</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-97] [net] org.apache.commons.net.nntp.Article.getReferences() throws ClassCastException</title>
<link>http://issues.apache.org/jira/browse/NET-97</link>

                    <description>Hello,

&lt;p&gt;org.apache.commons.net.nntp.Article.getReferences()throws a ClassCastException &lt;br/&gt;
if there exist references (added by addReference).&lt;/p&gt;

&lt;p&gt;return (String[]) list.toArray(); contains an unsupported cast operation&lt;br/&gt;
 Object[] -&amp;gt; String[]&lt;/p&gt;

&lt;p&gt;Secondly:&lt;/p&gt;

&lt;p&gt;int terminator = references.toString().indexOf(&apos;:&apos;);&lt;br/&gt;
StringTokenizer st =&lt;br/&gt;
new StringTokenizer(references.substring( terminator), &quot;\t&quot;);&lt;/p&gt;

&lt;p&gt;lets the first reference start with &quot;:&quot; which is not expected.&lt;/p&gt;

&lt;p&gt;best Regards,&lt;br/&gt;
  Oliver.&lt;/p&gt;</description>
                <environment>Operating System: All&lt;br/&gt;
Platform: All</environment>
            <key id="12342873">NET-97</key>
        <summary>[net] org.apache.commons.net.nntp.Article.getReferences() throws ClassCastException</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="oliver.randschau@web.de">Oliver Randschau</reporter>
            
    <created>Thu, 26 Jan 2006 12:03:02 -0800 (PST)</created>
    <updated>Thu, 3 Jan 2008 11:39:33 -0800 (PST)</updated>

                
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12411326" author="rwinston@eircom.net" created="Sat, 28 Jan 2006 15:16:18 -0800 (PST)"  >Thanks for the info. I have fixed the condition that caused the Exception.</comment>
                    <comment id="12555651" author="ktoole" created="Thu, 3 Jan 2008 11:39:33 -0800 (PST)"  >the 1.4.1 release still appears to have this issue with the unsupported cast.  What version contains this fix?</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>38400</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-33] [net] __openDataConnection does not close ServerSocket after server.accept() timesout</title>
<link>http://issues.apache.org/jira/browse/NET-33</link>

                    <description>In org.apache.commons.net.ftp.FTPClient&lt;br/&gt;
in method &quot;protected Socket &lt;em&gt;openDataConnection&lt;/em&gt;(int command, String arg) throws&lt;br/&gt;
IOException&quot; after server.accept() times out, it leaves the socket open in&lt;br/&gt;
listening mode and just progates the exception. It should close the socket&lt;br/&gt;
before propogating the exception.

&lt;p&gt;            // For now, let&apos;s just use the data timeout value for waiting for&lt;br/&gt;
            // the data connection.  It may be desirable to let this be a&lt;br/&gt;
            // separately configurable value.  In any case, we really want&lt;br/&gt;
            // to allow preventing the accept from blocking indefinitely.&lt;br/&gt;
            if (__dataTimeout &amp;gt;= 0)&lt;br/&gt;
                server.setSoTimeout(__dataTimeout);&lt;br/&gt;
            try{
            socket = server.accept();
            }catch(SocketTimeoutException ste){
            server.close(); 
            throw ste;
            }&lt;br/&gt;
            server.close();&lt;br/&gt;
        }&lt;br/&gt;
        else&lt;br/&gt;
        { .....&lt;br/&gt;
.....&lt;/p&gt;</description>
                <environment>Operating System: other&lt;br/&gt;
Platform: All</environment>
            <key id="12342872">NET-33</key>
        <summary>[net] __openDataConnection does not close ServerSocket after server.accept() timesout</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="dhillon_tegbir@hotmail.com">Tegbir Singh DHILLON</reporter>
            
    <created>Wed, 25 Jan 2006 13:58:31 -0800 (PST)</created>
    <updated>Wed, 19 Sep 2007 22:31:07 -0700 (PDT)</updated>

                
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12411325" author="rwinston@eircom.net" created="Sat, 28 Jan 2006 18:52:57 -0800 (PST)"  >Added a catch-and-rethrow that closes the ServerSocket before rethrowing.</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>38381</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-57] [net] How to implement FTPS extending FTPClient, from a diferente package...</title>
<link>http://issues.apache.org/jira/browse/NET-57</link>

                    <description>Hi everybody, I&apos;m Jose from Spain.

&lt;p&gt;I make an implement of FTPS: using&lt;br/&gt;
&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://sourceforge.net/projects/ufsc&quot;&gt;http://sourceforge.net/projects/ufsc&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt; implementation (which use a new&lt;br/&gt;
class, created by UFSC, org.apache.commons.net.ftp.FtpsClient that&lt;br/&gt;
extends org.apache.commons.net.ftp.FTPClient), with some minor&lt;br/&gt;
modification to adapt Java 1.3 and solve some fix with PASV transfer&lt;br/&gt;
(modification and fix, that i comunicate to the author).&lt;/p&gt;

&lt;p&gt;I try to build FtpsClient under diferent packege, then i found that&lt;br/&gt;
couldn&apos;t do it because, in org.apache.commons.net.ftp.FTP the&lt;br/&gt;
variables&lt;/p&gt;

&lt;p&gt;BufferedReader _controlInput;&lt;br/&gt;
BufferedWriter _controlOutput;&lt;/p&gt;

&lt;p&gt;were declare with packege visibility, and FtpsClient use this, to&lt;br/&gt;
implement securety&lt;br/&gt;
connection to SSLSocket. Something like this:&lt;/p&gt;

&lt;p&gt;this._controlInput = new BufferedReader(new&lt;br/&gt;
InputStreamReader(socket.getInputStream(), getControlEncoding()));&lt;br/&gt;
this._controlOutput = new BufferedWriter(new&lt;br/&gt;
OutputStreamWriter(socket.getOutputStream(), getControlEncoding()));&lt;/p&gt;

&lt;p&gt;Because of this, FtpsClient, in UFSC, is under org.apache.commons.net.ftp.&lt;/p&gt;

&lt;p&gt;Then the solution I adopt, was copy (and minor modify) FTPClient and&lt;br/&gt;
FTP from org.apache.commons.net.ftp in my own package, and extends&lt;br/&gt;
FtpsClient, from my own FTPClient, to make it in a difetent pakage...&lt;/p&gt;

&lt;p&gt;And my suggestion is: It could be possible, for future version, declare&lt;br/&gt;
protected, for simplify the extension of api, to implement FTPS, or other future&lt;br/&gt;
protocol... in diferent package...?&lt;/p&gt;

&lt;p&gt;as well, could by a setter, for this variables, to assing then the socket stream...&lt;/p&gt;

&lt;p&gt;Thanks to all.&lt;/p&gt;</description>
                <environment>Operating System: All&lt;br/&gt;
Platform: All</environment>
            <key id="12342862">NET-57</key>
        <summary>[net] How to implement FTPS extending FTPClient, from a diferente package...</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="josejuan.montiel@gmail.com">Jose Juan Montiel</reporter>
            
    <created>Wed, 18 Jan 2006 16:00:09 -0800 (PST)</created>
    <updated>Tue, 16 May 2006 05:06:06 -0700 (PDT)</updated>

                        <version>1.4</version>
            
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12411270" author="scohen@apache.org" created="Thu, 19 Jan 2006 02:59:33 -0800 (PST)"  >What do you think of this, Daniel?  Is there a good reason NOT to make these&lt;br/&gt;
data members protected or provide setters/getters for them?

&lt;p&gt;An alternative idea, if Jose is willing, might be for Jose to make local&lt;br/&gt;
modifications and then, once he&apos;s gotten his FTPSClient working, submit it as a&lt;br/&gt;
patch to be added to commons-net.&lt;/p&gt;
</comment>
                    <comment id="12411271" author="josejuan.montiel@gmail.com" created="Thu, 19 Jan 2006 23:31:26 -0800 (PST)"  >Created an attachment (id=17460)&lt;br/&gt;
Patch to solve the problem of extension FTP to other protocol...

&lt;p&gt;This is the patch that make the variables, protected, this is the only thing i&lt;br/&gt;
need, to extends FTPClient to FTPSClient, in other package...&lt;/p&gt;</comment>
                    <comment id="12411272" author="josejuan.montiel@gmail.com" created="Thu, 19 Jan 2006 23:33:48 -0800 (PST)"  >(In reply to comment #1)&lt;br/&gt;
&amp;gt; What do you think of this, Daniel?  Is there a good reason NOT to make these&lt;br/&gt;
&amp;gt; data members protected or provide setters/getters for them?&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; An alternative idea, if Jose is willing, might be for Jose to make local&lt;br/&gt;
&amp;gt; modifications and then, once he&apos;s gotten his FTPSClient working, submit it as a&lt;br/&gt;
&amp;gt; patch to be added to commons-net.

&lt;p&gt;I submit the patch. &lt;br/&gt;
Thanks for your time and attention.&lt;/p&gt;</comment>
                    <comment id="12411273" author="scohen@apache.org" created="Fri, 20 Jan 2006 01:55:25 -0800 (PST)"  >Jose, you misunderstood me.  I was asking if you would be willing to submit your&lt;br/&gt;
FTPSClient as a patch.  It would have been a nice extension to commons-net if it&lt;br/&gt;
worked out.  

&lt;p&gt;But I should have read your submission more carefully.  I didn&apos;t realize that&lt;br/&gt;
UFSC was another open source project.  I don&apos;t know what the licensing issues&lt;br/&gt;
would be, but it&apos;s likely to be a nightmare.&lt;/p&gt;

&lt;p&gt;So, back to you, Daniel.  Do you have any objections to Jose&apos;s patch.&lt;/p&gt;



</comment>
                    <comment id="12411274" author="dfs@apache.org" created="Fri, 20 Jan 2006 02:29:43 -0800 (PST)"  >I made the change, but added documentation.</comment>
                    <comment id="12411275" author="scohen@apache.org" created="Fri, 20 Jan 2006 03:21:04 -0800 (PST)"  >(In reply to comment #5)&lt;br/&gt;
&amp;gt; I made the change, but added documentation.

&lt;p&gt;I read your documentation but it raises a question.  Are you meaning to suggest&lt;br/&gt;
that the RIGHT way to do this is to overwrite &lt;em&gt;connectAction&lt;/em&gt;()?&lt;/p&gt;</comment>
                    <comment id="12411276" author="josejuan.montiel@gmail.com" created="Fri, 20 Jan 2006 11:29:04 -0800 (PST)"  >(In reply to comment #6)&lt;br/&gt;
&amp;gt; (In reply to comment #5)&lt;br/&gt;
&amp;gt; &amp;gt; I made the change, but added documentation.&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; I read your documentation but it raises a question.  Are you meaning to suggest&lt;br/&gt;
&amp;gt; that the RIGHT way to do this is to overwrite &lt;em&gt;connectAction&lt;/em&gt;()?&lt;br/&gt;
&amp;gt; 

&lt;p&gt;(In reply to comment #6)&lt;br/&gt;
&amp;gt; (In reply to comment #5)&lt;br/&gt;
&amp;gt; &amp;gt; I made the change, but added documentation.&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; I read your documentation but it raises a question.  Are you meaning to suggest&lt;br/&gt;
&amp;gt; that the RIGHT way to do this is to overwrite &lt;em&gt;connectAction&lt;/em&gt;()?&lt;br/&gt;
&amp;gt; &lt;/p&gt;

&lt;p&gt;Hi, i write to Paul Ferraro, the developer of UFSC and suggest that he could&lt;br/&gt;
change its licence from LGPL to APACHE, in this way i could apply the patch,&lt;br/&gt;
with my modifications of his code. I&apos;m waiting his anwers.&lt;/p&gt;

&lt;p&gt;FTPS its very similar to FTP, the most significant diferences are:&lt;br/&gt;
javax.net.ssl.SSLSocket, certificates, and after connect sends AUTH SSL, that&lt;br/&gt;
negotiates the secure method connection, and handshake... his implementation,&lt;br/&gt;
don&apos;t overwrite, only use the variables, to assing them &quot;ssl streams&quot; of the SSl&lt;br/&gt;
socket.&lt;/p&gt;

&lt;p&gt;I&apos;ll tell you, when he responds me.&lt;/p&gt;</comment>
                    <comment id="12411277" author="scohen@apache.org" created="Fri, 20 Jan 2006 14:31:07 -0800 (PST)"  >(In reply to comment #7)&lt;br/&gt;
 my modifications of his code. I&apos;m waiting his anwers.&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; FTPS its very similar to FTP, the most significant diferences are:&lt;br/&gt;
&amp;gt; javax.net.ssl.SSLSocket, certificates, and after connect sends AUTH SSL, that&lt;br/&gt;
&amp;gt; negotiates the secure method connection, and handshake... his implementation,&lt;br/&gt;
&amp;gt; don&apos;t overwrite, only use the variables, to assing them &quot;ssl streams&quot; of the SSl&lt;br/&gt;
&amp;gt; socket.&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; I&apos;ll tell you, when he responds me.

&lt;p&gt;So if you didn&apos;t need to change these variables, all you really needed was a&lt;br/&gt;
getter method.  Daniel, maybe that would be a better solution?  I don&apos;t imagine&lt;br/&gt;
you&apos;re too comfortable with exposing stuff that begins and ends with underscores?&lt;/p&gt;

&lt;p&gt;Jose, it would be great if we could bring FTPS into commons-net.&lt;/p&gt;
</comment>
                    <comment id="12411278" author="dfs@apache.org" created="Fri, 20 Jan 2006 20:05:58 -0800 (PST)"  >(In reply to comment #6)&lt;br/&gt;
&amp;gt; I read your documentation but it raises a question.  Are you meaning to suggest&lt;br/&gt;
&amp;gt; that the RIGHT way to do this is to overwrite &lt;em&gt;connectAction&lt;/em&gt;()?

&lt;p&gt;I was only trying to indicate where and how the variable was assigned in the&lt;br/&gt;
FTP class so that there would be no surprises to someone using the protected&lt;br/&gt;
variables.&lt;/p&gt;</comment>
                    <comment id="12411279" author="dfs@apache.org" created="Fri, 20 Jan 2006 20:19:03 -0800 (PST)"  >(In reply to comment #8)&lt;br/&gt;
&amp;gt; So if you didn&apos;t need to change these variables, all you really needed was a&lt;br/&gt;
&amp;gt; getter method.  Daniel, maybe that would be a better solution?  I don&apos;t imagine&lt;br/&gt;
&amp;gt; you&apos;re too comfortable with exposing stuff that begins and ends with underscores?

&lt;p&gt;Since the underlying SocketClient stream members are already protected,&lt;br/&gt;
I couldn&apos;t see how making the FTP reader wrappers protected would be&lt;br/&gt;
dangerous.  Until now, there hadn&apos;t been a need to expose that bit outside&lt;br/&gt;
of the package. As far as the underscores go, I was just trying to remain&lt;br/&gt;
consistent with the variable naming convention originally used in that code.&lt;br/&gt;
For better or for worse, protected members were distinguished by leading and&lt;br/&gt;
trailing underscores.&lt;/p&gt;

&lt;p&gt;At any rate, I don&apos;t have any strong feelings about the matter.  In general,&lt;br/&gt;
if someone using the library needs to specialize its behavior through&lt;br/&gt;
inheritance, I figure it&apos;s evidence the need should be accommodated as long&lt;br/&gt;
as there isn&apos;t some other way of meeting the need (e.g., aggregation).&lt;/p&gt;</comment>
                    <comment id="12411280" author="josejuan.montiel@gmail.com" created="Sun, 22 Jan 2006 19:09:48 -0800 (PST)"  >Created an attachment (id=17483)&lt;br/&gt;
Patch that make __fileType protected in FTPClient.

&lt;p&gt;The implements of FTPSClient, need that __fileType be protected, because, need&lt;br/&gt;
to overwrite retrieveFile, and in this method, depend on filetype, its recieve&lt;br/&gt;
in adecuate way.&lt;/p&gt;</comment>
                    <comment id="12411281" author="josejuan.montiel@gmail.com" created="Sun, 22 Jan 2006 19:14:55 -0800 (PST)"  >Created an attachment (id=17484)&lt;br/&gt;
Implementation of FTPSClient.

&lt;p&gt;Paul Ferraro change the license of his proyecto to Apache License V2.0. Then I&lt;br/&gt;
submit the 3 class that implements FTPSClient, and fourth class, ftps, that use&lt;br/&gt;
this implementation.&lt;/p&gt;</comment>
                    <comment id="12411282" author="scohen@apache.org" created="Sun, 22 Jan 2006 23:27:54 -0800 (PST)"  >(In reply to comment #12)&lt;br/&gt;
&amp;gt; Created an attachment (id=17484) &lt;span class=&quot;error&quot;&gt;&amp;#91;edit&amp;#93;&lt;/span&gt;&lt;br/&gt;
&amp;gt; Implementation of FTPSClient.&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; Paul Ferraro change the license of his proyecto to Apache License V2.0. Then I&lt;br/&gt;
&amp;gt; submit the 3 class that implements FTPSClient, and fourth class, ftps, that use&lt;br/&gt;
&amp;gt; this implementation.

&lt;p&gt;Thank you, Jose and Paul.  I have a few questions about the submission.&lt;/p&gt;

&lt;p&gt;1.  You are importing com.sun.net.ssl.X509TrustManagern and&lt;br/&gt;
com.sun.net.ssl.SSLContext.  Are these allowable imports under the terms of the&lt;br/&gt;
Apache License?  I don&apos;t know the answer, it is a question.  We have been&lt;br/&gt;
recently hit with licensing questions and I don&apos;t want to go through this again&lt;br/&gt;
without checking first.&lt;/p&gt;

&lt;p&gt;2.  Does this import require importing any additional libraries, or is this&lt;br/&gt;
class included in a J2SDK library.  If so, which version?&lt;/p&gt;

&lt;p&gt;3.  FTPSClient overrides the retrieveFile() method from FTPClient.  I am not an&lt;br/&gt;
expert in FTPS but shouldn&apos;t similar overrides be provided for storeFile(),&lt;br/&gt;
deleteFile()?  How about listFiles() and listNames()?  Can you point us to a&lt;br/&gt;
definition of the FTPS protocol that defines what is required?&lt;/p&gt;

&lt;p&gt;4.  Assuming all the above are answered, we would like some JUnit tests to be&lt;br/&gt;
created for the new classes.  The present tests can serve as a model for you.&lt;/p&gt;

&lt;p&gt;5.  Finally, the files need to have the Apache License.&lt;/p&gt;

&lt;p&gt;Please do not take this the wrong way.  I am being very demanding and legalistic&lt;br/&gt;
here, because I know that the Jakarta project is being closely watched from some&lt;br/&gt;
quarters, but I very much want this to go forward if at all possible.&lt;/p&gt;

&lt;p&gt;I also think that this is not the place for this discussion to be continued. &lt;br/&gt;
Now that we are on to legal as well as coding issues, the discussion should move&lt;br/&gt;
back to the commons-dev mailing list, which is where I am moving it.&lt;/p&gt;


</comment>
                    <comment id="12411283" author="ishigami@victokai.co.jp" created="Mon, 23 Jan 2006 13:11:32 -0800 (PST)"  >I checked his patches and read RFC2228, RFC4217 and some internet web sites.&lt;br/&gt;
It would be great if following things are done for the future work of FTPS.

&lt;p&gt;1) implicit mode.&lt;br/&gt;
   There is the two mode of FTPS to connect it securely. (implicit/explicit)&lt;br/&gt;
   It is implemented only the explicit mode.&lt;/p&gt;

&lt;p&gt;2) It can not specify multiple keystores and/or trustmanagers.&lt;br/&gt;
   I want to use multiple keystores and/or trustmanagers.&lt;/p&gt;

&lt;p&gt;3) The password to access KeyStore can not change.&lt;br/&gt;
   I think that this lacks security.&lt;/p&gt;

&lt;p&gt;4) It can not change the data connection security level(PROT command).&lt;/p&gt;

&lt;p&gt;5) It can not change the protected data bufferes(PBSZ command).&lt;/p&gt;

&lt;p&gt;6) The X509TrustManager should be made by implements&lt;br/&gt;
   javax.net.ssl.X509TrustManager. But, X509TrustManager interface is a part&lt;br/&gt;
   of JSSE, so there are not included in JDK1.3. The JSSE was introduced&lt;br/&gt;
   since JDK1.4 by default.&lt;/p&gt;

&lt;p&gt;(In reply to comment #8)&lt;br/&gt;
&amp;gt; (In reply to comment #7)&lt;br/&gt;
&amp;gt;  my modifications of his code. I&apos;m waiting his anwers.&lt;br/&gt;
&amp;gt; &amp;gt; &lt;br/&gt;
&amp;gt; &amp;gt; FTPS its very similar to FTP, the most significant diferences are:&lt;br/&gt;
&amp;gt; &amp;gt; javax.net.ssl.SSLSocket, certificates, and after connect sends AUTH SSL, that&lt;br/&gt;
&amp;gt; &amp;gt; negotiates the secure method connection, and handshake... his implementation,&lt;br/&gt;
&amp;gt; &amp;gt; don&apos;t overwrite, only use the variables, to assing them &quot;ssl streams&quot; of the SSl&lt;br/&gt;
&amp;gt; &amp;gt; socket.&lt;br/&gt;
&amp;gt; &amp;gt; &lt;br/&gt;
&amp;gt; &amp;gt; I&apos;ll tell you, when he responds me.&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; So if you didn&apos;t need to change these variables, all you really needed was a&lt;br/&gt;
&amp;gt; getter method.  Daniel, maybe that would be a better solution?  I don&apos;t imagine&lt;br/&gt;
&amp;gt; you&apos;re too comfortable with exposing stuff that begins and ends with underscores?&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; Jose, it would be great if we could bring FTPS into commons-net.&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; &lt;/p&gt;
</comment>
                    <comment id="12411284" author="josejuan.montiel@gmail.com" created="Mon, 23 Jan 2006 13:37:48 -0800 (PST)"  >Created an attachment (id=17488)&lt;br/&gt;
Implementation of FTPSClient.

&lt;p&gt;Added the commented modification...&lt;/p&gt;</comment>
                    <comment id="12411285" author="josejuan.montiel@gmail.com" created="Mon, 23 Jan 2006 13:49:20 -0800 (PST)"  >(In reply to comment #13)&lt;br/&gt;
&amp;gt; 1.  You are importing com.sun.net.ssl.X509TrustManagern and&lt;br/&gt;
&amp;gt; com.sun.net.ssl.SSLContext.  Are these allowable imports under the terms of the&lt;br/&gt;
&amp;gt; Apache License?  I don&apos;t know the answer, it is a question.  We have been&lt;br/&gt;
&amp;gt; recently hit with licensing questions and I don&apos;t want to go through this again&lt;br/&gt;
&amp;gt; without checking first.

&lt;p&gt;I really don&apos;t know about legal, this import its into JSSE&lt;br/&gt;
(&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://java.sun.com/products/jsse/LICENSE.html&quot;&gt;http://java.sun.com/products/jsse/LICENSE.html&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;), because i want use ftps, with&lt;br/&gt;
JDK 1.3, but... there is a correspondent Java 1.4 classes for com.sun.net...&lt;/p&gt;

&lt;p&gt;&amp;gt; 2.  Does this import require importing any additional libraries, or is this&lt;br/&gt;
&amp;gt; class included in a J2SDK library.  If so, which version?&lt;/p&gt;

&lt;p&gt;This import require Java 1.3 &amp;amp; JSSE.&lt;/p&gt;

&lt;p&gt;&amp;gt; 3.  FTPSClient overrides the retrieveFile() method from FTPClient.  I am not an&lt;br/&gt;
&amp;gt; expert in FTPS but shouldn&apos;t similar overrides be provided for storeFile(),&lt;br/&gt;
&amp;gt; deleteFile()?  How about listFiles() and listNames()?  Can you point us to a&lt;br/&gt;
&amp;gt; definition of the FTPS protocol that defines what is required?&lt;/p&gt;

&lt;p&gt;Now, following the paul advice, now only overwrite &lt;em&gt;openDataConnection&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&amp;gt; 4.  Assuming all the above are answered, we would like some JUnit tests to be&lt;br/&gt;
&amp;gt; created for the new classes.  The present tests can serve as a model for you.&lt;/p&gt;

&lt;p&gt;I attach one junit, to test, with a &quot;local ftps server&quot; of the &quot;junit machine&quot;.&lt;/p&gt;

&lt;p&gt;&amp;gt; 5.  Finally, the files need to have the Apache License.&lt;/p&gt;

&lt;p&gt;Add.&lt;/p&gt;

&lt;p&gt;&amp;gt; Please do not take this the wrong way.  I am being very demanding and legalistic&lt;br/&gt;
&amp;gt; here, because I know that the Jakarta project is being closely watched from some&lt;br/&gt;
&amp;gt; quarters, but I very much want this to go forward if at all possible.&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; I also think that this is not the place for this discussion to be continued. &lt;br/&gt;
&amp;gt; Now that we are on to legal as well as coding issues, the discussion should move&lt;br/&gt;
&amp;gt; back to the commons-dev mailing list, which is where I am moving it.&lt;/p&gt;

&lt;p&gt;Don&apos;t worry... and thanks for all.&lt;/p&gt;</comment>
                    <comment id="12411286" author="josejuan.montiel@gmail.com" created="Mon, 23 Jan 2006 13:52:40 -0800 (PST)"  >(In reply to comment #14)&lt;br/&gt;
&amp;gt; I checked his patches and read RFC2228, RFC4217 and some internet web sites.&lt;br/&gt;
&amp;gt; It would be great if following things are done for the future work of FTPS.&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; 1) implicit mode.&lt;br/&gt;
&amp;gt;    There is the two mode of FTPS to connect it securely. (implicit/explicit)&lt;br/&gt;
&amp;gt;    It is implemented only the explicit mode.

&lt;p&gt;For future work...&lt;/p&gt;

&lt;p&gt;&amp;gt; 2) It can not specify multiple keystores and/or trustmanagers.&lt;br/&gt;
&amp;gt;    I want to use multiple keystores and/or trustmanagers.&lt;/p&gt;

&lt;p&gt;It was implemented in code of 2006-01-22 19:14.&lt;/p&gt;

&lt;p&gt;&amp;gt; 3) The password to access KeyStore can not change.&lt;br/&gt;
&amp;gt;    I think that this lacks security.&lt;/p&gt;

&lt;p&gt;Implemented now.&lt;/p&gt;

&lt;p&gt;&amp;gt; 4) It can not change the data connection security level(PROT command).&lt;/p&gt;

&lt;p&gt;Implemented now.&lt;/p&gt;

&lt;p&gt;&amp;gt; 5) It can not change the protected data bufferes(PBSZ command).&lt;/p&gt;

&lt;p&gt;Implemented now.&lt;/p&gt;

&lt;p&gt;&amp;gt; 6) The X509TrustManager should be made by implements&lt;br/&gt;
&amp;gt;    javax.net.ssl.X509TrustManager. But, X509TrustManager interface is a part&lt;br/&gt;
&amp;gt;    of JSSE, so there are not included in JDK1.3. The JSSE was introduced&lt;br/&gt;
&amp;gt;    since JDK1.4 by default.&lt;/p&gt;

&lt;p&gt;I need that ftps works with JDK1.3, and dont mind import JSSE...&lt;/p&gt;

&lt;p&gt;Thanks for all your comment.&lt;/p&gt;</comment>
                    <comment id="12411287" author="scohen@apache.org" created="Tue, 24 Jan 2006 00:54:28 -0800 (PST)"  >TO: EVERYONE

&lt;p&gt;PLEASE LET&apos;S NOT HAVE ANY MORE DISCUSSIONS RELATED TO THE POSSIBLE ADDITION OF&lt;br/&gt;
FTPS FUNCTIONALITY TO COMMONS-NET AS COMMENTS ON THIS BUG.  &lt;/p&gt;

&lt;p&gt;This bug is now closed.  Comments related to the lively discussion of adding&lt;br/&gt;
FTPS to commons-net should be made on the commons-dev mailing list:&lt;br/&gt;
commons-dev@jakarta.apache.org. &lt;/p&gt;</comment>
                </comments>
    
    <attachments>
            <attachment id="12333992" name="ftps.zip" size="8280" author="josejuan.montiel@gmail.com" created="Mon, 23 Jan 2006 13:37:48 -0800 (PST)" />
            <attachment id="12333991" name="ftps.zip" size="5237" author="josejuan.montiel@gmail.com" created="Sun, 22 Jan 2006 19:14:55 -0800 (PST)" />
            <attachment id="12333990" name="patch.txt" size="940" author="josejuan.montiel@gmail.com" created="Sun, 22 Jan 2006 19:09:48 -0800 (PST)" />
            <attachment id="12333989" name="patch.txt" size="646" author="josejuan.montiel@gmail.com" created="Thu, 19 Jan 2006 23:31:26 -0800 (PST)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>38309</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-31] [net] Freeze during FTP connect</title>
<link>http://issues.apache.org/jira/browse/NET-31</link>

                    <description>Several times a day a Java process open FTP connections (using Commons Net) and&lt;br/&gt;
some times (approximately twice a week) the process hang until I kill it.&lt;br/&gt;
By looking at the dump it seems the lock appears during the connection opening&lt;br/&gt;
but I have no clue why it happens.

&lt;p&gt;Here are the information I have :&lt;/p&gt;

&lt;p&gt;-------------------------------&lt;br/&gt;
FTP client :&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;OS &quot;Red Hat Enterprise Linux ES release 3 (Taroon Update 2)&quot;&lt;/li&gt;
	&lt;li&gt;Java j2sdk1.4.2_05&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;FTP server on windows&lt;/p&gt;

&lt;p&gt;-------------------------------&lt;/p&gt;

&lt;p&gt;Thread dump get through kill -3 on java process :&lt;/p&gt;

&lt;p&gt;Full thread dump Java HotSpot(TM) Client VM (1.4.2_05-b04 mixed mode):&lt;/p&gt;

&lt;p&gt;&quot;Thread-1&quot; daemon prio=1 tid=0x081e2cc0 nid=0x72c5 runnable &lt;span class=&quot;error&quot;&gt;&amp;#91;a926e000..a926e87c&amp;#93;&lt;/span&gt;&lt;br/&gt;
        at java.net.SocketInputStream.socketRead0(Native Method)&lt;br/&gt;
        at java.net.SocketInputStream.read(SocketInputStream.java:129)&lt;br/&gt;
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)&lt;br/&gt;
        at java.io.BufferedInputStream.read(BufferedInputStream.java:201)&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;locked &amp;lt;0xaadc0d80&amp;gt; (a java.io.BufferedInputStream)&lt;br/&gt;
        at java.io.FilterInputStream.read(FilterInputStream.java:66)&lt;br/&gt;
        at java.io.PushbackInputStream.read(PushbackInputStream.java:120)&lt;br/&gt;
        at&lt;br/&gt;
org.apache.commons.net.io.FromNetASCIIInputStream.__read(FromNetASCIIInputStream.java:75)&lt;br/&gt;
        at&lt;br/&gt;
org.apache.commons.net.io.FromNetASCIIInputStream.read(FromNetASCIIInputStream.java:170)&lt;br/&gt;
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)&lt;br/&gt;
        at java.io.BufferedInputStream.read(BufferedInputStream.java:201)&lt;/li&gt;
	&lt;li&gt;locked &amp;lt;0xaadc0028&amp;gt; (a org.apache.commons.net.telnet.TelnetInputStream)&lt;br/&gt;
        at&lt;br/&gt;
org.apache.commons.net.telnet.TelnetInputStream.__read(TelnetInputStream.java:114)&lt;br/&gt;
        at&lt;br/&gt;
org.apache.commons.net.telnet.TelnetInputStream.run(TelnetInputStream.java:535)&lt;br/&gt;
        at java.lang.Thread.run(Thread.java:534)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&quot;Signal Dispatcher&quot; daemon prio=1 tid=0x0809c440 nid=0x72c5 waiting on condition&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;0..0&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&quot;Finalizer&quot; daemon prio=1 tid=0x08097aa0 nid=0x72c5 in Object.wait()&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;aabbd000..aabbd87c&amp;#93;&lt;/span&gt;&lt;br/&gt;
        at java.lang.Object.wait(Native Method)&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;waiting on &amp;lt;0xab22b7a8&amp;gt; (a java.lang.ref.ReferenceQueue$Lock)&lt;br/&gt;
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)&lt;/li&gt;
	&lt;li&gt;locked &amp;lt;0xab22b7a8&amp;gt; (a java.lang.ref.ReferenceQueue$Lock)&lt;br/&gt;
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)&lt;br/&gt;
        at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&quot;Reference Handler&quot; daemon prio=1 tid=0x08096ef8 nid=0x72c5 in Object.wait()&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;aac3e000..aac3e87c&amp;#93;&lt;/span&gt;&lt;br/&gt;
        at java.lang.Object.wait(Native Method)&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;waiting on &amp;lt;0xab22b810&amp;gt; (a java.lang.ref.Reference$Lock)&lt;br/&gt;
        at java.lang.Object.wait(Object.java:429)&lt;br/&gt;
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:115)&lt;/li&gt;
	&lt;li&gt;locked &amp;lt;0xab22b810&amp;gt; (a java.lang.ref.Reference$Lock)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&quot;main&quot; prio=1 tid=0x0805ba20 nid=0x72c5 in Object.wait() &lt;span class=&quot;error&quot;&gt;&amp;#91;bfff9000..bfff9eec&amp;#93;&lt;/span&gt;&lt;br/&gt;
        at java.lang.Object.wait(Native Method)&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;waiting on &amp;lt;0xaad40000&amp;gt; (a [I)&lt;br/&gt;
        at java.lang.Object.wait(Object.java:429)&lt;br/&gt;
        at&lt;br/&gt;
org.apache.commons.net.telnet.TelnetInputStream.read(TelnetInputStream.java:339)&lt;/li&gt;
	&lt;li&gt;locked &amp;lt;0xaad40000&amp;gt; (a [I)&lt;br/&gt;
        at&lt;br/&gt;
org.apache.commons.net.telnet.TelnetInputStream.read(TelnetInputStream.java:466)&lt;br/&gt;
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:220)&lt;br/&gt;
        at java.io.BufferedInputStream.read(BufferedInputStream.java:277)&lt;/li&gt;
	&lt;li&gt;locked &amp;lt;0xaad42108&amp;gt; (a java.io.BufferedInputStream)&lt;br/&gt;
        at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:408)&lt;br/&gt;
        at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:450)&lt;br/&gt;
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:182)&lt;/li&gt;
	&lt;li&gt;locked &amp;lt;0xaad42988&amp;gt; (a java.io.InputStreamReader)&lt;br/&gt;
        at java.io.InputStreamReader.read(InputStreamReader.java:167)&lt;br/&gt;
        at java.io.BufferedReader.fill(BufferedReader.java:136)&lt;br/&gt;
at java.io.BufferedReader.readLine(BufferedReader.java:299)&lt;/li&gt;
	&lt;li&gt;locked &amp;lt;0xaad42988&amp;gt; (a java.io.InputStreamReader)&lt;br/&gt;
        at java.io.BufferedReader.readLine(BufferedReader.java:362)&lt;br/&gt;
        at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:264)&lt;br/&gt;
        at org.apache.commons.net.ftp.FTP.&lt;em&gt;connectAction&lt;/em&gt;(FTP.java:335)&lt;br/&gt;
        at org.apache.commons.net.ftp.FTPClient.&lt;em&gt;connectAction&lt;/em&gt;(FTPClient.java:550)&lt;br/&gt;
        at org.apache.commons.net.SocketClient.connect(SocketClient.java:163)&lt;br/&gt;
        at org.apache.commons.net.SocketClient.connect(SocketClient.java:250)&lt;br/&gt;
        at com.cnetchannel.common.ftp.connect(ftp.java:405)&lt;br/&gt;
        at com.cnetchannel.dataSource.increment(dataSource.java:137)&lt;br/&gt;
        at com.cnetchannel.dataSource.main(dataSource.java:62)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&quot;VM Thread&quot; prio=1 tid=0x08095c98 nid=0x72c5 runnable&lt;/p&gt;

&lt;p&gt;&quot;VM Periodic Task Thread&quot; prio=1 tid=0x0809ec70 nid=0x72c5 waiting on condition&lt;br/&gt;
&quot;Suspend Checker Thread&quot; prio=1 tid=0x0809bae8 nid=0x72c5 runnable&lt;/p&gt;</description>
                <environment>Operating System: Linux&lt;br/&gt;
Platform: Other</environment>
            <key id="12342843">NET-31</key>
        <summary>[net] Freeze during FTP connect</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="thomasgt96-java@yahoo.com">ThomasGt</reporter>
            
    <created>Fri, 6 Jan 2006 10:14:11 -0800 (PST)</created>
    <updated>Tue, 29 Jan 2008 07:33:33 -0800 (PST)</updated>

                        <version>1.4</version>
            
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12411220" author="scohen@apache.org" created="Sat, 7 Jan 2006 00:52:17 -0800 (PST)"  >Can you please supply relevant snippets of code?</comment>
                    <comment id="12448994" author="rwinston@eircom.net" created="Sat, 11 Nov 2006 08:15:29 -0800 (PST)"  >This should now be fixed in 2.0, now that FTPClient extends SocketClient directly.</comment>
                    <comment id="12563551" author="praveen.mangu" created="Tue, 29 Jan 2008 07:33:24 -0800 (PST)"  >Hi,

&lt;p&gt;I&apos;m also facing the freeze during a call to connect() on Windows XP with J2SE &lt;br/&gt;
5.0:&lt;/p&gt;

&lt;p&gt;Thread dump:&lt;br/&gt;
at java/lang/Object.wait(Native Method)&lt;br/&gt;
at java/lang/Object.wait(Object.java:199(Compiled Code))&lt;br/&gt;
at org/apache/commons/net/telnet/TelnetInputStream.read&lt;br/&gt;
(TelnetInputStream.java:313(Compiled Code))&lt;br/&gt;
at org/apache/commons/net/telnet/TelnetInputStream.read&lt;br/&gt;
(TelnetInputStream.java:466(Compiled Code))&lt;br/&gt;
at java/io/BufferedInputStream.read1(BufferedInputStream.java:265(Compiled &lt;br/&gt;
Code))&lt;br/&gt;
at java/io/BufferedInputStream.read(BufferedInputStream.java:324(Compiled &lt;br/&gt;
Code))&lt;br/&gt;
at java/io/FilterInputStream.read(FilterInputStream.java:113(Compiled Code))&lt;br/&gt;
at sun/nio/cs/StreamDecoder$ConverterSD.implRead(StreamDecoder.java:352&lt;br/&gt;
(Compiled Code))&lt;br/&gt;
at sun/nio/cs/StreamDecoder.read(StreamDecoder.java:250(Compiled Code))&lt;br/&gt;
at java/io/InputStreamReader.read(InputStreamReader.java:212(Compiled Code))&lt;br/&gt;
at java/io/BufferedReader.fill(BufferedReader.java:157(Compiled Code))&lt;br/&gt;
at java/io/BufferedReader.readLine(BufferedReader.java:320(Compiled Code))&lt;br/&gt;
at java/io/BufferedReader.readLine(BufferedReader.java:383(Compiled Code))&lt;br/&gt;
at org/apache/commons/net/ftp/FTP.__getReply(FTP.java:264(Compiled Code))&lt;br/&gt;
at org/apache/commons/net/ftp/FTP.&lt;em&gt;connectAction&lt;/em&gt;(FTP.java:335(Compiled Code))&lt;br/&gt;
at org/apache/commons/net/ftp/FTPClient.&lt;em&gt;connectAction&lt;/em&gt;(FTPClient.java:550)&lt;br/&gt;
at org/apache/commons/net/SocketClient.connect(SocketClient.java:163)&lt;/p&gt;

&lt;p&gt;-------------------------------------------------------------------------------&lt;/p&gt;

&lt;p&gt;Could you let me know when Commons Net 2.0 would be officially released?&lt;/p&gt;</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>38160</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-62] [net] FTP Client fails to retrieve file list</title>
<link>http://issues.apache.org/jira/browse/NET-62</link>

                    <description>[&lt;br/&gt;
  using commons-net-1.4.1.jar&lt;br/&gt;
  jsdk 1.4.2_08&lt;br/&gt;
]

&lt;p&gt;a) Both ftp servers require authorization.&lt;br/&gt;
b) login and authorization complete successfully.&lt;br/&gt;
c) change of working directory completes successfully.&lt;br/&gt;
d) At the end is the connection log using FileZilla to connect to ftp servers.&lt;br/&gt;
e) Both of the fetches below fail when a file exists in directory:&lt;/p&gt;

&lt;p&gt;FTPListParseEngine engine = this.initiateListParsing();&lt;br/&gt;
FTPFile[] m_files = engine.getFiles();&lt;/p&gt;

&lt;p&gt;OR &lt;/p&gt;

&lt;p&gt;FTPFile[] m_files = this.listFiles();&lt;/p&gt;

&lt;p&gt;where THIS = the org.apache.commons.net.ftp.FTPClient&lt;/p&gt;

&lt;p&gt;Any ideas why I can&apos;t get a file list?&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;ul&gt;
			&lt;li&gt;
			&lt;ul&gt;
				&lt;li&gt;
				&lt;ul&gt;
					&lt;li&gt;
					&lt;ul&gt;
						&lt;li&gt;
						&lt;ul&gt;
							&lt;li&gt;
							&lt;ul&gt;
								&lt;li&gt;
								&lt;ul&gt;
									&lt;li&gt;
									&lt;ul&gt;
										&lt;li&gt;
										&lt;ul&gt;
											&lt;li&gt;FileZilla Connection Log ***************&lt;/li&gt;
											&lt;li&gt;I replace server names/ips with &amp;lt;HOST (A or B)&amp;gt; ***********&lt;/li&gt;
										&lt;/ul&gt;
										&lt;/li&gt;
									&lt;/ul&gt;
									&lt;/li&gt;
								&lt;/ul&gt;
								&lt;/li&gt;
							&lt;/ul&gt;
							&lt;/li&gt;
						&lt;/ul&gt;
						&lt;/li&gt;
					&lt;/ul&gt;
					&lt;/li&gt;
				&lt;/ul&gt;
				&lt;/li&gt;
			&lt;/ul&gt;
			&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Status:	Connecting to &amp;lt;HOSTA&amp;gt; ...&lt;br/&gt;
Status:	Connected with &amp;lt;HOSTA&amp;gt;. Waiting for welcome message...&lt;br/&gt;
Response:	220 ProFTPD 1.2.10 Server (&amp;lt;HOSTA&amp;gt;) &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;lt;HOSTA&amp;gt;&amp;#93;&lt;/span&gt;&lt;br/&gt;
Command:	USER myusername&lt;br/&gt;
Response:	331 Password required for filer.&lt;br/&gt;
Command:	PASS ******&lt;br/&gt;
Response:	230 User myusername logged in.&lt;br/&gt;
Command:	FEAT&lt;br/&gt;
Response:	211-Features:&lt;br/&gt;
Response:	 MDTM&lt;br/&gt;
Response:	 REST STREAM&lt;br/&gt;
Response:	 SIZE&lt;br/&gt;
Response:	211 End&lt;br/&gt;
Command:	SYST&lt;br/&gt;
Response:	215 UNIX Type: L8&lt;br/&gt;
Status:	Connected&lt;br/&gt;
Status:	Retrieving directory listing...&lt;br/&gt;
Command:	PWD&lt;br/&gt;
Response:	257 &quot;/&quot; is current directory.&lt;br/&gt;
Command:	TYPE A&lt;br/&gt;
Response:	200 Type set to A&lt;br/&gt;
Command:	PASV&lt;br/&gt;
Response:	227 Entering Passive Mode (&amp;lt;HOSTA IP LIST&amp;gt;).&lt;br/&gt;
Command:	LIST&lt;br/&gt;
Response:	150 Opening ASCII mode data connection for file list&lt;br/&gt;
Response:	226 Transfer complete.&lt;br/&gt;
Status:	Directory listing successful&lt;br/&gt;
Command:	TYPE I&lt;br/&gt;
Response:	200 Type set to I&lt;br/&gt;
Command:	PWD&lt;br/&gt;
Response:	257 &quot;/&quot; is current directory.&lt;br/&gt;
Command:	REST 0&lt;br/&gt;
Response:	350 Restarting at 0. Send STORE or RETRIEVE to initiate transfer&lt;br/&gt;
Command:	REST 0&lt;br/&gt;
Response:	350 Restarting at 0. Send STORE or RETRIEVE to initiate transfer&lt;br/&gt;
Status:	Disconnected from server&lt;br/&gt;
Status:	Connecting to &amp;lt;HOSTB&amp;gt; ...&lt;br/&gt;
Status:	Connected with &amp;lt;HOSTB&amp;gt;. Waiting for welcome message...&lt;br/&gt;
Response:	220 &amp;lt;HOSTB&amp;gt; NcFTPd Server (licensed copy) ready.&lt;br/&gt;
Command:	USER myusername&lt;br/&gt;
Response:	331 User myusername okay, need password.&lt;br/&gt;
Command:	PASS **********&lt;br/&gt;
Response:	230-You are user #5 of 150 simultaneous users allowed.&lt;br/&gt;
Response:	230-&lt;br/&gt;
Response:	230 Restricted user logged in.&lt;br/&gt;
Command:	FEAT&lt;br/&gt;
Response:	211-Extensions supported:&lt;br/&gt;
Response:	 CLNT&lt;br/&gt;
Response:	 LANG EN*&lt;br/&gt;
Response:	 MDTM&lt;br/&gt;
Response:	 MLST&lt;br/&gt;
Type*;Size*;Modify*;Perm;Unique;UNIX.mode*;UNIX.owner;UNIX.uid;UNIX.group;UNIX.gid;&lt;br/&gt;
Response:	 PASV&lt;br/&gt;
Response:	 REST STREAM&lt;br/&gt;
Response:	 SIZE&lt;br/&gt;
Response:	 UTF8&lt;br/&gt;
Response:	 TVFS&lt;br/&gt;
Response:	 Compliance Level: 20040701 (IETF mlst-16)&lt;br/&gt;
Response:	211 End.&lt;br/&gt;
Command:	CLNT FileZilla&lt;br/&gt;
Response:	200 Noted.&lt;br/&gt;
Command:	OPTS UTF8 ON&lt;br/&gt;
Response:	501 Option not recognized.&lt;br/&gt;
Command:	SYST&lt;br/&gt;
Response:	215 UNIX Type: L8&lt;br/&gt;
Status:	Connected&lt;br/&gt;
Status:	Retrieving directory listing...&lt;br/&gt;
Command:	PWD&lt;br/&gt;
Response:	257 &quot;/&quot; is cwd.&lt;br/&gt;
Command:	TYPE A&lt;br/&gt;
Response:	200 Type okay.&lt;br/&gt;
Command:	PASV&lt;br/&gt;
Response:	227 Entering Passive Mode (&amp;lt;HOSTB IP List&amp;gt;)&lt;br/&gt;
Command:	LIST&lt;br/&gt;
Response:	150 Data connection accepted from &amp;lt;CLIENT&amp;gt;:1229; transfer starting.&lt;br/&gt;
Response:	226 Listing completed.&lt;br/&gt;
Status:	Directory listing successful&lt;br/&gt;
Command:	TYPE A&lt;br/&gt;
Response:	200 Type okay.&lt;br/&gt;
Status:	Disconnected from server&lt;/p&gt;</description>
                <environment>Operating System: Windows 2000&lt;br/&gt;
Platform: PC</environment>
            <key id="12342818">NET-62</key>
        <summary>[net] FTP Client fails to retrieve file list</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="pcgoober">Kevin Wilson</reporter>
            
    <created>Tue, 27 Dec 2005 20:58:28 -0800 (PST)</created>
    <updated>Wed, 19 Sep 2007 22:31:10 -0700 (PDT)</updated>

                        <version>1.4</version>
            
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12411125" author="pcgoober" created="Tue, 27 Dec 2005 21:30:53 -0800 (PST)"  >Hold on, I think I have proxy issue that is screwin&apos; stuff up.</comment>
                    <comment id="12411126" author="pcgoober" created="Tue, 27 Dec 2005 22:51:44 -0800 (PST)"  >Ok,

&lt;p&gt;I have verified all proxies are bypassed.&lt;/p&gt;

&lt;p&gt;In issuing the raw FTPClient.list() command results in 2 codes being returned.&lt;/p&gt;

&lt;p&gt;a) from our local ftp server I get CODE 425&lt;br/&gt;
b) from the remote ftp server I connect to I get CODE 550.&lt;/p&gt;

&lt;p&gt;And no files are returned by using listFiles() still.&lt;/p&gt;</comment>
                    <comment id="12411127" author="pcgoober" created="Wed, 28 Dec 2005 19:53:53 -0800 (PST)"  >Ok, I can fetch a file off our ftp server but I still can&apos;t get a directory&lt;br/&gt;
listing to check to see if any files are there to download.</comment>
                    <comment id="12411128" author="pcgoober" created="Wed, 28 Dec 2005 20:39:30 -0800 (PST)"  >function FTPClient.retrieveFile() doesn&apos;t download ZIP files without corrupting&lt;br/&gt;
them, I can download a text file without issue. Changing the&lt;br/&gt;
FTPCLient.setFileTransferMode(mode) to binary before tranfer does not help.
</comment>
                    <comment id="12411129" author="pcgoober" created="Wed, 28 Dec 2005 21:07:18 -0800 (PST)"  >String[] FTPClient.listNames() works as expected. The cwd list of files and&lt;br/&gt;
directories are returned. There must be something wrong with the parser&lt;br/&gt;
detection or the building of the FTPFile object that doesn&apos;t allow listFiles()&lt;br/&gt;
to work properly.</comment>
                    <comment id="12411130" author="pcgoober" created="Wed, 28 Dec 2005 22:12:04 -0800 (PST)"  >May have a problem that just might be the cause as to why listFiles() isn&apos;t&lt;br/&gt;
working. When attempting to use listFiles(path) to get a single file I get the&lt;br/&gt;
following exception. (code I am using is at the end of this message)

&lt;p&gt;*****************************************************************************&lt;br/&gt;
java.lang.NoClassDefFoundError: org/apache/oro/text/regex/MalformedPatternException&lt;br/&gt;
        at&lt;br/&gt;
org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createUnixFTPEntryParser(DefaultFTPFileEntryParserFactory.java:169)&lt;br/&gt;
        at&lt;br/&gt;
org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createFileEntryParser(DefaultFTPFileEntryParserFactory.java:94)&lt;br/&gt;
        at&lt;br/&gt;
org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2358)&lt;br/&gt;
        at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2141)&lt;br/&gt;
        at&lt;br/&gt;
com.comtrol.global.connections.FTPTransfer.checkFile(FTPTransfer.java:119)&lt;br/&gt;
        at com.synfoserv.actions.ActionServlet.checkSPSFTP(ActionServlet.java:443)&lt;br/&gt;
        at com.synfoserv.actions.ActionServlet.access$400(ActionServlet.java:27)&lt;br/&gt;
        at com.synfoserv.actions.ActionServlet$2.run(ActionServlet.java:52)&lt;br/&gt;
        at java.util.TimerThread.mainLoop(Timer.java:432)&lt;br/&gt;
        at java.util.TimerThread.run(Timer.java:382)&lt;br/&gt;
*****************************************************************************&lt;/p&gt;

&lt;p&gt;public FTPFile checkFile(String sServerFile){&lt;br/&gt;
    FTPFile f = null;&lt;br/&gt;
    FTPFile[] fa = null;&lt;br/&gt;
    try{&lt;br/&gt;
      fa = this.listFiles(sServerFile);&lt;br/&gt;
      if(fa != null){
        f = fa[0];
      }&lt;br/&gt;
    }catch(Exception e){System.out.println(&quot;checkFile() Error: \n&quot; +
e.getMessage());}&lt;br/&gt;
    return f;&lt;br/&gt;
  }&lt;/p&gt;</comment>
                    <comment id="12411131" author="pcgoober" created="Wed, 28 Dec 2005 22:16:10 -0800 (PST)"  >RegexFTPFileEntryParserImpl.java still has these import definitions but the ORO&lt;br/&gt;
package is not included in src or jar file.

&lt;p&gt;***********************************************************&lt;br/&gt;
import org.apache.oro.text.regex.MalformedPatternException;&lt;br/&gt;
import org.apache.oro.text.regex.MatchResult;&lt;br/&gt;
import org.apache.oro.text.regex.Pattern;&lt;br/&gt;
import org.apache.oro.text.regex.PatternMatcher;&lt;br/&gt;
import org.apache.oro.text.regex.Perl5Compiler;&lt;br/&gt;
import org.apache.oro.text.regex.Perl5Matcher;&lt;br/&gt;
***********************************************************&lt;/p&gt;</comment>
                    <comment id="12411132" author="pcgoober" created="Wed, 28 Dec 2005 22:17:14 -0800 (PST)"  >VMSVersioningFTPEntryParser.java has the imports I mentioned as well.</comment>
                    <comment id="12411133" author="pcgoober" created="Wed, 28 Dec 2005 22:46:13 -0800 (PST)"  >ORO package is required for commons-net-ftp parsers to function. I did not find&lt;br/&gt;
that mentioned anywhere on &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://jakarta.apache.org/commons/net/&quot;&gt;http://jakarta.apache.org/commons/net/&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt; other than&lt;br/&gt;
stating the commons-net was originally developed by ORO, Inc.

&lt;p&gt;Also, netbeans did not bark at all when the library was added, shouldn&apos;t it have?&lt;/p&gt;</comment>
                    <comment id="12411134" author="pcgoober" created="Wed, 28 Dec 2005 23:06:00 -0800 (PST)"  >You must have the ORO package for the parser functions to work. It would be nice&lt;br/&gt;
for the commons-net download page to state that the ORO package is a dependency.

&lt;p&gt;Zip files still download corrupted though. And so far FTPFile.isFile() is&lt;br/&gt;
returning false positive on directories.&lt;/p&gt;</comment>
                    <comment id="12411135" author="scohen@apache.org" created="Fri, 30 Dec 2005 22:47:13 -0800 (PST)"  >Whoa.  Sorry it&apos;s taken so long to respond (I was out of town) but you are&lt;br/&gt;
combining three or four issues into one defect report and that&apos;s never a good&lt;br/&gt;
idea.  Please, in the future one bug report per defect.  Now, let me try to help&lt;br/&gt;
you.

&lt;p&gt;Re: the dependency on ORO: this has been published for years.  It is listed on&lt;br/&gt;
the page &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://jakarta.apache.org/commons/net/dependencies.html&quot;&gt;http://jakarta.apache.org/commons/net/dependencies.html&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;.  A link to&lt;br/&gt;
that page is available under the menu heading &quot;Project Info&quot;.&lt;/p&gt;

&lt;p&gt;Re: corrupting zip files: I am guessing that this issue is the same as the one&lt;br/&gt;
you filed a few minutes later as a problem with WinZip files so I will not&lt;br/&gt;
comment on that here.&lt;/p&gt;

&lt;p&gt;Based on that, I am closing the issue.&lt;/p&gt;


</comment>
                    <comment id="12411136" author="pcgoober" created="Tue, 3 Jan 2006 16:26:46 -0800 (PST)"  >Sorry but this page would be a better location to give a blurb about what else&lt;br/&gt;
is required to use the package (imo) ...

&lt;p&gt;&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://jakarta.apache.org/site/downloads/index.html&quot;&gt;http://jakarta.apache.org/site/downloads/index.html&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;</comment>
                    <comment id="12411137" author="scohen@apache.org" created="Wed, 4 Jan 2006 01:54:14 -0800 (PST)"  >I see your point, but I don&apos;t agree that this page is the right one either.  For&lt;br/&gt;
one thing that page is not under the control of commons-net developers but under&lt;br/&gt;
the control of the whole jakarta-commons system.  I could imagine that a list of&lt;br/&gt;
dependencies there might get unwieldy.

&lt;p&gt;At a bare minimum, though, I think this belongs at the very top of the FAQ, as&lt;br/&gt;
we hear this fairly frequently.  Would you have looked there?  Another idea is&lt;br/&gt;
that since the dependency is found only in a couple of places, we could trap the&lt;br/&gt;
ClassNotFoundException and emit a message that says explicitly that jakarta-oro&lt;br/&gt;
is required.&lt;/p&gt;</comment>
                    <comment id="12411138" author="scohen@apache.org" created="Wed, 4 Jan 2006 05:22:10 -0800 (PST)"  >Reopened because I&apos;ve decided to accomodate the reporter&apos;s request to make the&lt;br/&gt;
oro dependency more obvious.</comment>
                    <comment id="12411139" author="scohen@apache.org" created="Wed, 4 Jan 2006 05:29:51 -0800 (PST)"  >Accomodated the desire for better documentation of the ORO dependency by &lt;br/&gt;
1) putting a question about it in the FAQ on the Wiki&lt;br/&gt;
2) wrapping the NoClassDefFoundError thrown in the parser creation process in a&lt;br/&gt;
ParserInitializationException with a message explicitly indicating the need for&lt;br/&gt;
jakarta-oro.jar to be on the classpath.</comment>
                    <comment id="12411140" author="pcgoober" created="Wed, 4 Jan 2006 17:01:42 -0800 (PST)"  >Thanks, this should help immensely.

&lt;p&gt;&amp;gt;2) wrapping the NoClassDefFoundError thrown in the parser creation process in a&lt;br/&gt;
&amp;gt;ParserInitializationException with a message explicitly indicating the need for&lt;br/&gt;
&amp;gt;jakarta-oro.jar to be on the classpath.&lt;/p&gt;</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>38055</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-13] [net] Unit tests fail for commons-net-1.4.1 with NullPointerException</title>
<link>http://issues.apache.org/jira/browse/NET-13</link>

                    <description>I&apos;m working on updating the commons-net package for Gentoo to the most recent&lt;br/&gt;
version, 1.4.1, and ran into a problem running the unit tests:

&lt;p&gt;    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt; Testsuite: org.apache.commons.net.time.TimeTCPClientTest&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt; Tests run: 2, Failures: 0, Errors: 1, Time elapsed: 1.093 sec&lt;/p&gt;

&lt;p&gt;    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt; Testcase: testInitial took 0.009 sec&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt; Testcase: testCompareTimes took 1.074 sec&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt;     Caused an ERROR&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt; null&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt; java.lang.NullPointerException&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt;     at&lt;br/&gt;
org.apache.commons.net.SocketClient.disconnect(SocketClient.java:266)&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt;     at&lt;br/&gt;
org.apache.commons.net.time.TimeTCPClientTest.testCompareTimes(TimeTCPClientTest.java:133)&lt;/p&gt;


&lt;p&gt;Upon further investigation into SocketClient, I found that disconnect() tried to&lt;br/&gt;
close a few objects, without checking that they weren&apos;t null. Adding a simple&lt;br/&gt;
check for null is enough to get the tests to pass.&lt;/p&gt;</description>
                <environment>Operating System: Linux&lt;br/&gt;
Platform: PC</environment>
            <key id="12342812">NET-13</key>
        <summary>[net] Unit tests fail for commons-net-1.4.1 with NullPointerException</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="nichoj@gentoo.org">Joshua Nichols</reporter>
            
    <created>Wed, 21 Dec 2005 07:07:03 -0800 (PST)</created>
    <updated>Wed, 19 Sep 2007 22:31:03 -0700 (PDT)</updated>

                
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12411107" author="nichoj@gentoo.org" created="Wed, 21 Dec 2005 07:10:14 -0800 (PST)"  >Created an attachment (id=17250)&lt;br/&gt;
commons-net-1.4.1-socketclient.patch

&lt;p&gt;This patch solves the problem. I&apos;m going to go ahead with packaging 1.4.1 using&lt;br/&gt;
this patch, unless there&apos;s some overwhelming reason not to.&lt;/p&gt;</comment>
                    <comment id="12411108" author="dfs@apache.org" created="Wed, 21 Dec 2005 23:17:19 -0800 (PST)"  >disconnect should not be called on a SocketClient instance that has not&lt;br/&gt;
been successfully connected.  If there&apos;s a problem, it would be&lt;br/&gt;
with the unit test, not SocketClient. In other words, the test code should be&lt;br/&gt;
  if(client.isConnected())&lt;br/&gt;
    client.disconnect();&lt;br/&gt;
instead of&lt;br/&gt;
  client.disconnect();

&lt;p&gt;However, if you do that, then the unit test doesn&apos;t fail when a connection&lt;br/&gt;
is not established.  So you could write&lt;br/&gt;
  if(client.isConnected())&lt;br/&gt;
    client.disconnect();&lt;br/&gt;
  else&lt;br/&gt;
    throw SomeAppropriateException(&quot;Connection failed.&quot;);&lt;/p&gt;

&lt;p&gt;But since client.disconnect() already throws an exception, I have to assume&lt;br/&gt;
the test writer opted for the shorter&lt;br/&gt;
   client.disconnect();&lt;/p&gt;

&lt;p&gt;In short, the test is supposed to fail if it can&apos;t connect.&lt;/p&gt;</comment>
                    <comment id="12411109" author="dfs@apache.org" created="Wed, 21 Dec 2005 23:24:43 -0800 (PST)"  >(In reply to comment #1)&lt;br/&gt;
&amp;gt; This patch solves the problem. I&apos;m going to go ahead with packaging 1.4.1 using&lt;br/&gt;
&amp;gt; this patch, unless there&apos;s some overwhelming reason not to.

&lt;p&gt;I don&apos;t mean to speak for the rest of the Commons Net developers, but I think&lt;br/&gt;
we&apos;d rather you package it by bypassing the unit tests during packaging.&lt;br/&gt;
Applying your patch may cause more bug reports from people who call disconnect()&lt;br/&gt;
improperly.  With the patch, they&apos;ll have no indication they did something wrong.&lt;br/&gt;
We can discuss this further on commons-dev.&lt;/p&gt;</comment>
                    <comment id="12411110" author="nichoj@gentoo.org" created="Wed, 21 Dec 2005 23:38:46 -0800 (PST)"  >
&lt;p&gt;(In reply to comment #2)&lt;br/&gt;
&amp;gt; disconnect should not be called on a SocketClient instance that has not&lt;br/&gt;
&amp;gt; been successfully connected.  If there&apos;s a problem, it would be&lt;br/&gt;
&amp;gt; with the unit test, not SocketClient. In other words, the test code should be&lt;br/&gt;
&amp;gt;   if(client.isConnected())&lt;br/&gt;
&amp;gt;     client.disconnect();&lt;br/&gt;
&amp;gt; instead of&lt;br/&gt;
&amp;gt;   client.disconnect();&lt;br/&gt;
&amp;gt; However, if you do that, then the unit test doesn&apos;t fail when a connection&lt;br/&gt;
&amp;gt; is not established.  So you could write&lt;br/&gt;
&amp;gt;   if(client.isConnected())&lt;br/&gt;
&amp;gt;     client.disconnect();&lt;br/&gt;
&amp;gt;   else&lt;br/&gt;
&amp;gt;     throw SomeAppropriateException(&quot;Connection failed.&quot;);&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; But since client.disconnect() already throws an exception, I have to assume&lt;br/&gt;
&amp;gt; the test writer opted for the shorter&lt;br/&gt;
&amp;gt;    client.disconnect();&lt;/p&gt;

&lt;p&gt;Fair enough. However, I think that some exception should be thrown (maybe&lt;br/&gt;
IllegalStateException?) that indicates that the object is in an invalid state,&lt;br/&gt;
instead of letting a NullPointerException occur.&lt;/p&gt;

&lt;p&gt;&amp;gt; &lt;br/&gt;
&amp;gt; In short, the test is supposed to fail if it can&apos;t connect.&lt;br/&gt;
I can accept that the test would fail if it can&apos;t connect. However, it really&lt;br/&gt;
shouldn&apos;t be because of a NullPointerException.&lt;/p&gt;


&lt;p&gt;(In reply to comment #3)&lt;br/&gt;
&amp;gt; I don&apos;t mean to speak for the rest of the Commons Net developers, but I think&lt;br/&gt;
&amp;gt; we&apos;d rather you package it by bypassing the unit tests during packaging.&lt;/p&gt;

&lt;p&gt;I concurr about not including the patch. We actually prefer to keep packages as&lt;br/&gt;
close to upstream as possible.&lt;/p&gt;

&lt;p&gt;&amp;gt; Applying your patch may cause more bug reports from people who call disconnect()&lt;br/&gt;
&amp;gt; improperly.  With the patch, they&apos;ll have no indication they did something wrong.&lt;br/&gt;
&amp;gt; We can discuss this further on commons-dev.&lt;/p&gt;

&lt;p&gt;The current code doesn&apos;t give much better of an indication that something went&lt;br/&gt;
wrong, so perhaps throwing an exception, like I mentioned above, is more&lt;br/&gt;
appropriate?&lt;/p&gt;</comment>
                    <comment id="12411111" author="dfs@apache.org" created="Fri, 23 Dec 2005 22:30:05 -0800 (PST)"  >
&lt;p&gt;I changed the test to check isConnected before calling disconnect.  My&lt;br/&gt;
original statement about what the original test writer probably intended&lt;br/&gt;
was incorrect.  connect() throws an exception when it fails.  The lack&lt;br/&gt;
of any catch block indicates the test writer intended for the original&lt;br/&gt;
exception to pass through.  However, in that context--by placing the&lt;br/&gt;
disconnect in a finally block--it is incorrect for the test to call&lt;br/&gt;
disconnect without first checking isConnected.  Sorry for my original&lt;br/&gt;
misdiagnosis.&lt;/p&gt;

&lt;p&gt;With regard to SocketClient, I have no objection to making disconnect throw&lt;br/&gt;
an IllegalStateException if that is where the consensus of the Commons Net&lt;br/&gt;
user and developer community has moved.  However, that would be an&lt;br/&gt;
enhancement request and should be discussed on the commons-dev mailing&lt;br/&gt;
list first.  The reason an  IllegalStateException is not thrown is because&lt;br/&gt;
the library was designed with the philosophy of not checking every possible&lt;br/&gt;
API misuse and throwing an exception in each case.  Doing so would have&lt;br/&gt;
littered the code with a lot of if then else throw sequences, making the&lt;br/&gt;
API throw even more exceptions than it already does.  The consensus in the&lt;br/&gt;
past has been to not check every possible mistake in API use.  However,&lt;br/&gt;
that consensus can be retested on commons-dev.&lt;/p&gt;</comment>
                    <comment id="12411112" author="scohen@apache.org" created="Sat, 24 Dec 2005 02:38:01 -0800 (PST)"  >My only comment here is that you&apos;ve patched the head which is not the same as&lt;br/&gt;
patching version 1.4.1.  This is exactly the right thing to have done, I am not&lt;br/&gt;
criticizing at all but I just want to clarify this point since the summary&lt;br/&gt;
mentions 1.4.1 specifically.

&lt;p&gt;Version 1.4.1 was handled as a BRANCH off 1.4.0, rather than the usual release&lt;br/&gt;
off the latest HEAD.  I did it this way because we were getting frequent&lt;br/&gt;
complaints about our binary packages being incompatible with JDK 1.3, and I was&lt;br/&gt;
pressed for time and it was easier.  1.4.1 fixes the 1.3 JDK  problem and only&lt;br/&gt;
that problem.  It doesn&apos;t even include changes made to the HEAD since 1.4.0&lt;br/&gt;
before the release of 1.4.1.  &lt;/p&gt;

&lt;p&gt;I mainly bring this up because we&apos;re probably approaching the point where we&lt;br/&gt;
should think about making a proper 1.4.2 release that releases all the fixed&lt;br/&gt;
defects we&apos;ve accumulated over the past 7 or 8 months.&lt;/p&gt;</comment>
                </comments>
    
    <attachments>
            <attachment id="12333959" name="commons-net-1.4.1-socketclient.patch" size="1055" author="nichoj@gentoo.org" created="Wed, 21 Dec 2005 07:10:14 -0800 (PST)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>37985</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-96] [net] commons-net 1.4.0 binaries are incorrectly compiled as JDK 1.4</title>
<link>http://issues.apache.org/jira/browse/NET-96</link>

                    <description>Commons-Net is supposed to be targeting jdk 1.2, yet project.properties for the&lt;br/&gt;
project contains the line

&lt;p&gt;maven.compile.target=1.4&lt;/p&gt;

&lt;p&gt;Although some of the incompatibilites were cleaned up in SOURCE earlier, the&lt;br/&gt;
release binaries are wrong and cause problems for those who use jdk 1.3.x.&lt;/p&gt;</description>
                <environment>Operating System: All&lt;br/&gt;
Platform: All</environment>
            <key id="12342719">NET-96</key>
        <summary>[net] commons-net 1.4.0 binaries are incorrectly compiled as JDK 1.4</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="scohen@apache.org">Steve Cohen</reporter>
            
    <created>Wed, 16 Nov 2005 03:21:48 -0800 (PST)</created>
    <updated>Wed, 19 Sep 2007 22:31:15 -0700 (PDT)</updated>

                        <version>1.4</version>
            
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>37522</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-14] [net] [patch] Unable to compile with JDK 1.3</title>
<link>http://issues.apache.org/jira/browse/NET-14</link>

                    <description>Hi,

&lt;p&gt;due to few trivial errors the following classes of the commons-net package &lt;br/&gt;
does not compile with JDK 1.3.&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;org.apache.commons.net.nntp.Article&lt;/li&gt;
	&lt;li&gt;org.apache.commons.net.ftp.FTPClientConfig&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This can cause subtle linkage errors when using commons-net 1.4 under a JVM &lt;br/&gt;
1.3 environment.&lt;/p&gt;

&lt;p&gt;The problem applies to the development version too.&lt;/p&gt;

&lt;p&gt;See the attached patches to correct the problem.&lt;/p&gt;

&lt;p&gt;Andrea.&lt;/p&gt;</description>
                <environment>Operating System: other&lt;br/&gt;
Platform: Other</environment>
            <key id="12342640">NET-14</key>
        <summary>[net] [patch] Unable to compile with JDK 1.3</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="andrea.rombaldi@alice.it">Andrea Rombaldi</reporter>
            
    <created>Mon, 17 Oct 2005 09:49:46 -0700 (PDT)</created>
    <updated>Wed, 19 Sep 2007 22:31:04 -0700 (PDT)</updated>

                        <version>1.4</version>
            
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12410656" author="andrea.rombaldi@alice.it" created="Mon, 17 Oct 2005 09:51:10 -0700 (PDT)"  >Created an attachment (id=16713)&lt;br/&gt;
this patch makes Article.java compilable with JDK 1.3</comment>
                    <comment id="12410657" author="andrea.rombaldi@alice.it" created="Mon, 17 Oct 2005 09:51:50 -0700 (PDT)"  >Created an attachment (id=16714)&lt;br/&gt;
this patch makes FTPClientConfig.java compilable with JDK 1.3</comment>
                    <comment id="12410658" author="scohen@apache.org" created="Wed, 19 Oct 2005 03:26:12 -0700 (PDT)"  >Thanks a lot, Andrea.  I have committed these patches.</comment>
                </comments>
    
    <attachments>
            <attachment id="12333860" name="Article.patch" size="501" author="andrea.rombaldi@alice.it" created="Mon, 17 Oct 2005 09:51:10 -0700 (PDT)" />
            <attachment id="12333861" name="FTPClientConfig.patch" size="1855" author="andrea.rombaldi@alice.it" created="Mon, 17 Oct 2005 09:51:50 -0700 (PDT)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>37113</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-39] [net] Solution for ant ftp fails with Nullpointerexception when a symlink is evaluated in method checkRemoteSensitivity in FTP.java for a z/OS ftp server</title>
<link>http://issues.apache.org/jira/browse/NET-39</link>

                    <description>The following code is trying to download a file from a z/OS FTP server:&lt;br/&gt;
&amp;lt;ftp action=&quot;get&quot; server=&quot;${server}&quot; userid=&quot;${userid}&quot; password=&quot;${password}&quot;&lt;br/&gt;
remotedir=&quot;/usr/lpp/ims/imsjava91&quot;&amp;gt;&lt;br/&gt;
  &amp;lt;fileset dir=&quot;C:\temp&quot;&amp;gt;&lt;br/&gt;
    &amp;lt;include name=&quot;imsjava.jar&quot;/&amp;gt;&lt;br/&gt;
  &amp;lt;/fileset&amp;gt;&lt;br/&gt;
&amp;lt;/ftp&amp;gt;

&lt;p&gt;The directory in my case also contains symlinks to non Unix File Systems. For&lt;br/&gt;
those symlinks somehow the FTP classes are not able to obtain file information,&lt;br/&gt;
e.g. the following listing prints String target and array&lt;span class=&quot;error&quot;&gt;&amp;#91;pcounter&amp;#93;&lt;/span&gt; from method&lt;br/&gt;
checkRemoteSensitivity in org/apache/tools/ant/taskdefs/optional/net/FTP.java:&lt;/p&gt;

&lt;p&gt;      &lt;span class=&quot;error&quot;&gt;&amp;#91;ftp&amp;#93;&lt;/span&gt; getting files&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;ftp&amp;#93;&lt;/span&gt; ibm drwxr-xr-x   2 OMVSKERN SYS1        8192 Feb 14  2005 IBM&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;ftp&amp;#93;&lt;/span&gt; ibm &lt;del&gt;rw-r&lt;/del&gt;&lt;del&gt;r&lt;/del&gt;-   2 OMVSKERN SYS1        1963 Feb 14  2005 README&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;ftp&amp;#93;&lt;/span&gt; ibm drwxr-xr-x   3 OMVSKERN SYS1        8192 Feb 14  2005 cics&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;ftp&amp;#93;&lt;/span&gt; ibm drwxr-xr-x   4 OMVSKERN SYS1        8192 Jun 16 13:50 dlimodel&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;ftp&amp;#93;&lt;/span&gt; ibm &lt;del&gt;rw-r&lt;/del&gt;&lt;del&gt;r&lt;/del&gt;-   2 OMVSKERN SYS1      267217 Jun 16 13:50 imsjava.ja&lt;br/&gt;
r&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;ftp&amp;#93;&lt;/span&gt; ibm &lt;del&gt;rw-r&lt;/del&gt;&lt;del&gt;r&lt;/del&gt;-   2 OMVSKERN SYS1        5545 Jun 16 13:50 imsjava91.&lt;br/&gt;
rar&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;ftp&amp;#93;&lt;/span&gt; ibm drwxr-xr-x   3 OMVSKERN SYS1        8192 Feb 14  2005 lib&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;ftp&amp;#93;&lt;/span&gt; ibm null&lt;/p&gt;

&lt;p&gt;In FTP.java at line 536 it is not checked if array&lt;span class=&quot;error&quot;&gt;&amp;#91;pcounter&amp;#93;&lt;/span&gt; is null.&lt;/p&gt;

&lt;p&gt;Commons-net is at 1.4.0. Apache Ant version is 1.6.2 compiled on July 16 2004. I&lt;br/&gt;
did not try to research the cause in the code, why the file information is null.&lt;br/&gt;
For me I added an if clause around lines 536-538 to check if array&lt;span class=&quot;error&quot;&gt;&amp;#91;pcounter&amp;#93;&lt;/span&gt; is&lt;br/&gt;
null and this worked great.&lt;/p&gt;

&lt;p&gt;So I replaced lines:&lt;br/&gt;
                              if (array&lt;span class=&quot;error&quot;&gt;&amp;#91;pcounter&amp;#93;&lt;/span&gt;.getName().equals(target) &amp;amp;&amp;amp;&lt;br/&gt;
pcounter != icounter) {
                                candidateFound = false;
                              }&lt;br/&gt;
&lt;br/&gt;
with:&lt;br/&gt;
                           if (array&lt;span class=&quot;error&quot;&gt;&amp;#91;pcounter&amp;#93;&lt;/span&gt; != null) {&lt;br/&gt;
                              if (array&lt;span class=&quot;error&quot;&gt;&amp;#91;pcounter&amp;#93;&lt;/span&gt;.getName().equals(target) &amp;amp;&amp;amp;&lt;br/&gt;
pcounter != icounter) {                                candidateFound = false;                              } }&lt;br/&gt;
                           }&lt;/p&gt;

&lt;p&gt;I would highly appreciate to add that code to Ant, otherwise my customers will&lt;br/&gt;
not be able to use any Ant version for some z/OS directories.&lt;br/&gt;
Thank you in advance.&lt;/p&gt;</description>
                <environment>Operating System: Windows 2000&lt;br/&gt;
Platform: PC</environment>
            <key id="12342493">NET-39</key>
        <summary>[net] Solution for ant ftp fails with Nullpointerexception when a symlink is evaluated in method checkRemoteSensitivity in FTP.java for a z/OS ftp server</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="denisgaebler@netscape.net">Denis Gaebler</reporter>
            
    <created>Thu, 18 Aug 2005 21:22:21 -0700 (PDT)</created>
    <updated>Wed, 19 Sep 2007 22:31:07 -0700 (PDT)</updated>

                        <version>1.4</version>
            
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12410192" author="denisgaebler@netscape.net" created="Thu, 18 Aug 2005 21:40:29 -0700 (PDT)"  >Created an attachment (id=16103)&lt;br/&gt;
diff file for the solution

&lt;p&gt;It should be easy to forward fit this solution for newer versions of FTP.java&lt;/p&gt;</comment>
                    <comment id="12410193" author="stevel@apache.org" created="Fri, 19 Aug 2005 11:12:37 -0700 (PDT)"  >1. please try against CVS_HEAD or Ant1.6.5 and verify that the problem is still&lt;br/&gt;
there. I suspect it is, but, we need to be sure, and diffs against latest code&lt;br/&gt;
are easier to apply.

&lt;p&gt;2, the patch hides a symptom, not the underlying cause, and we should fix it&lt;br/&gt;
properly. Assuming the defect is in this code (now moved a bit down the files)&lt;/p&gt;

&lt;p&gt;            for (int icounter = 0; icounter &amp;lt; array.length; icounter++) {&lt;br/&gt;
                if (array&lt;span class=&quot;error&quot;&gt;&amp;#91;icounter&amp;#93;&lt;/span&gt;.isDirectory()) {&lt;br/&gt;
                    if (!array&lt;span class=&quot;error&quot;&gt;&amp;#91;icounter&amp;#93;&lt;/span&gt;.getName().equals(&quot;.&quot;)&lt;br/&gt;
                        &amp;amp;&amp;amp; !array&lt;span class=&quot;error&quot;&gt;&amp;#91;icounter&amp;#93;&lt;/span&gt;.getName().equals(&quot;..&quot;)) {&lt;br/&gt;
                        candidateFound = true;&lt;br/&gt;
                        target = fiddleName(array&lt;span class=&quot;error&quot;&gt;&amp;#91;icounter&amp;#93;&lt;/span&gt;.getName());&lt;br/&gt;
                        getProject().log(&quot;will try to cd to &quot;&lt;br/&gt;
                            + target + &quot; where a directory called &quot; +&lt;br/&gt;
array&lt;span class=&quot;error&quot;&gt;&amp;#91;icounter&amp;#93;&lt;/span&gt;.getName()&lt;br/&gt;
                            + &quot; exists&quot;, Project.MSG_DEBUG);&lt;br/&gt;
                        for (int pcounter = 0; pcounter &amp;lt; array.length;&lt;br/&gt;
pcounter++) {&lt;br/&gt;
                            if (array&lt;span class=&quot;error&quot;&gt;&amp;#91;pcounter&amp;#93;&lt;/span&gt;.getName().equals(target) &amp;amp;&amp;amp;&lt;br/&gt;
pcounter != icounter) {
                                candidateFound = false;
                            }&lt;br/&gt;
                        }&lt;br/&gt;
                        if (candidateFound) {
                            break;
                        }&lt;br/&gt;
                    }&lt;br/&gt;
                }&lt;br/&gt;
            }&lt;/p&gt;

&lt;p&gt;then we are iterating twice through the array. the outer loop needs to handle&lt;br/&gt;
nullness too, or we should strip null pointers out earlier. &lt;/p&gt;</comment>
                    <comment id="12410194" author="denisgaebler@netscape.net" created="Fri, 19 Aug 2005 14:10:04 -0700 (PDT)"  >(In reply to comment #2)&lt;br/&gt;
Hi Steve,

&lt;p&gt;the array&lt;span class=&quot;error&quot;&gt;&amp;#91;icounter&amp;#93;&lt;/span&gt;.isDirectory() for some reason returns always true, even if&lt;br/&gt;
array&lt;span class=&quot;error&quot;&gt;&amp;#91;icounter&amp;#93;&lt;/span&gt; is null and although the files are no directory. &lt;/p&gt;

&lt;p&gt;Buildfile: build.xml&lt;/p&gt;

&lt;p&gt;all:&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;ftp&amp;#93;&lt;/span&gt; getting files&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;ftp&amp;#93;&lt;/span&gt; isdirectory: true array: drwxr-xr-x   2 OMVSKERN SYS1        8192&lt;br/&gt;
Feb 14  2005 IBM&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;ftp&amp;#93;&lt;/span&gt; isdirectory: true array: &lt;del&gt;rw-r&lt;/del&gt;&lt;del&gt;r&lt;/del&gt;-   2 OMVSKERN SYS1        1963&lt;br/&gt;
Feb 14  2005 README&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;ftp&amp;#93;&lt;/span&gt; isdirectory: true array: drwxr-xr-x   3 OMVSKERN SYS1        8192&lt;br/&gt;
Feb 14  2005 cics&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;ftp&amp;#93;&lt;/span&gt; isdirectory: true array: drwxr-xr-x   4 OMVSKERN SYS1        8192&lt;br/&gt;
Jun 16 13:50 dlimodel&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;ftp&amp;#93;&lt;/span&gt; isdirectory: true array: &lt;del&gt;rw-r&lt;/del&gt;&lt;del&gt;r&lt;/del&gt;-   2 OMVSKERN SYS1      267217&lt;br/&gt;
Jun 16 13:50 imsjava.jar&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;ftp&amp;#93;&lt;/span&gt; isdirectory: true array: &lt;del&gt;rw-r&lt;/del&gt;&lt;del&gt;r&lt;/del&gt;-   2 OMVSKERN SYS1        5545&lt;br/&gt;
Jun 16 13:50 imsjava91.rar&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;ftp&amp;#93;&lt;/span&gt; isdirectory: true array: drwxr-xr-x   3 OMVSKERN SYS1        8192&lt;br/&gt;
Feb 14  2005 lib&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;ftp&amp;#93;&lt;/span&gt; isdirectory: true array: null&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;ftp&amp;#93;&lt;/span&gt; isdirectory: true array: drwxr-xr-x   8 OMVSKERN SYS1        8192&lt;br/&gt;
Jul 20 19:23 samples&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;ftp&amp;#93;&lt;/span&gt; isdirectory: true array: &lt;del&gt;rw-r&lt;/del&gt;&lt;del&gt;r&lt;/del&gt;-   1 OMVSKERN SYS1       87809&lt;br/&gt;
Sep 24  2004 samples.jar&lt;/p&gt;

&lt;p&gt;In addition, you are right. For my current directory it&apos;s luck, that the&lt;br/&gt;
NullPointerException does not occur in the outer loop.&lt;/p&gt;

&lt;p&gt;The root error seams to be in commons net classes, since with a wu-ftp server&lt;br/&gt;
the isdirectory() method works correct and only returns true for directories.&lt;br/&gt;
I&apos;ll try to find the cause of the array being null in case of a symbolic link in&lt;br/&gt;
the z/OS directory.&lt;/p&gt;</comment>
                    <comment id="12410195" author="stevel@apache.org" created="Fri, 19 Aug 2005 14:53:52 -0700 (PDT)"  >Maybe isDirectory() is final and the JVM is not checking things. 

&lt;p&gt;If this is a recurrent problem, the best tactic would be to strip null fields&lt;br/&gt;
from the array. And/Or we track it down to commons-net problem and have them fix&lt;br/&gt;
it. Best to do both, to deal with older versions of the c-net stack.&lt;/p&gt;</comment>
                    <comment id="12410196" author="denisgaebler@netscape.net" created="Fri, 19 Aug 2005 21:45:10 -0700 (PDT)"  >(In reply to comment #4)&lt;br/&gt;
I found the error in commons-net UnixFTPEntryParser.java&lt;br/&gt;
This class is unable to handle the external symlink permission bit in z/OS which&lt;br/&gt;
is e. &lt;br/&gt;
erwxrwxrwx   1 OMVSKERN SYS1           7 Feb 14  2005 libJavTDLI.so -&amp;gt; DFSCLIB&lt;br/&gt;
The regular expression which is defined there is not able to handle the e which&lt;br/&gt;
leeds to skip all processing and return a null FTPFile Object.

&lt;p&gt;I don&apos;t know, if you think it is still required to catch null entries. I try to&lt;br/&gt;
change the UnixFTPEntryParser.java to work.&lt;br/&gt;
Please let me know, if I should create a bug for the commons-net classes.&lt;/p&gt;</comment>
                    <comment id="12410197" author="denisgaebler@netscape.net" created="Fri, 19 Aug 2005 21:47:59 -0700 (PDT)"  >Here is the description of the e bit from the z/OS Unix System Services Manual:

&lt;p&gt; -e&lt;br/&gt;
    Specifies that the link created by ln be an external link. One purpose for&lt;br/&gt;
creating an external link is to create a mount point that an NFS client can use&lt;br/&gt;
to access a data set through the DFSMS/MVS&#174; Network File System feature. The&lt;br/&gt;
normal content of an external link is a name that refers to an object outside&lt;br/&gt;
the hierarchical file system, such as a data set. The data set that the&lt;br/&gt;
DFSMS/MVS Network File System feature uses can be any type of MVS data set. For&lt;br/&gt;
a partitioned data set, however, you specify a fully qualified name in all caps.&lt;br/&gt;
For example:&lt;/p&gt;

&lt;p&gt;          ln -e NOLL.PLIB.PGMA /u/noll/plib/pgma&lt;/p&gt;

&lt;p&gt;    External links can also be used to map an HFS file name to a PDS or PDSE&lt;br/&gt;
member name for an executable load module. An example of how you would define&lt;br/&gt;
the external link is:&lt;/p&gt;

&lt;p&gt;          ln -e MYPGM /u/smorg/mylongpgmname&lt;/p&gt;</comment>
                    <comment id="12410198" author="denisgaebler@netscape.net" created="Fri, 19 Aug 2005 22:20:14 -0700 (PDT)"  >Created an attachment (id=16118)&lt;br/&gt;
diff for UnixFTPEntryParser for commons-net-src-20050819

&lt;p&gt;It adds support for the z/OS external link bit e, which is so far not included&lt;br/&gt;
in the Regular Expression REGEX and sets the type for e to&lt;br/&gt;
FTPFile.SYMBOLIC_LINK_TYPE.&lt;br/&gt;
Its the org.apache.commons.net.ftp.parser.UnixFTPEntryParser and not the ftp2&lt;br/&gt;
one&lt;/p&gt;</comment>
                    <comment id="12410199" author="scohen@apache.org" created="Thu, 24 Nov 2005 03:13:46 -0800 (PST)"  >Pardon my ignorance, but I don&apos;t know very much about z/OS.  I do know something&lt;br/&gt;
about commons-net and the ftp parsers.

&lt;p&gt;Is this external link bit &quot;e&quot; something that is z/OS specific or do other&lt;br/&gt;
flavors of unix support it?  Would this break the parser on non-z/OS systems?&lt;/p&gt;

&lt;p&gt;Are there other differences between z/OS and regular unix FTP servers that we&lt;br/&gt;
need to take account of?&lt;/p&gt;

&lt;p&gt;Where I&apos;m going with this is:&lt;/p&gt;

&lt;p&gt;Would it be better to accept this patch or to create an independent parser for&lt;br/&gt;
z/OS?  To help answer this question, here&apos;s another:&lt;/p&gt;

&lt;p&gt;When connecting to a z/OS FTP server, what does the SYST ftp command return?&lt;/p&gt;

&lt;p&gt;Sorry to take so long in answering, but would like to have these questions&lt;br/&gt;
answered before I jump one way or the other.&lt;/p&gt;</comment>
                    <comment id="12410200" author="denisgaebler@netscape.net" created="Tue, 11 Apr 2006 16:57:55 -0700 (PDT)"  >(In reply to comment #8)&lt;br/&gt;
Hi Steve,

&lt;p&gt;sorry for the delay, I did not get an email for your update. We have been using&lt;br/&gt;
a modified version so far, but that is not really an ultimate solution.&lt;br/&gt;
For the first question, the e flag is something specific to z/OS since its to&lt;br/&gt;
only way to define links from the HFS UNIX file system to the traditional z/OS&lt;br/&gt;
filesystems which are called Datasets (sequential or partitioned).&lt;br/&gt;
I don&apos;t know of any other Unix that uses the e flag. Don&apos;t know if it is&lt;br/&gt;
specified somewhere else.&lt;/p&gt;

&lt;p&gt;I think it is better to have a parser for z/OS FTP Server, here is the SYST Output:&lt;br/&gt;
220-FTPD1 IBM FTP CS V1R7 at FLEXES.DFW.IBM.COM, 16:34:51 on 2006-04-11.&lt;br/&gt;
220 Connection will close if idle for more than 5 minutes.&lt;br/&gt;
Name (flexes.ehningen.de.ibm.com:gaebler):&lt;br/&gt;
331 Send password please.&lt;br/&gt;
Password:&lt;br/&gt;
230 GAEBLER is logged on.  Working directory is &quot;GAEBLER.&quot;.&lt;br/&gt;
Remote system type is MVS.&lt;br/&gt;
ftp&amp;gt; syst&lt;br/&gt;
215 MVS is the operating system of this server. FTP Server is running on z/OS.&lt;br/&gt;
ftp&amp;gt;&lt;/p&gt;

&lt;p&gt;Hope that helps, Denis.&lt;/p&gt;</comment>
                    <comment id="12430876" author="rwinston@eircom.net" created="Sun, 27 Aug 2006 10:05:37 -0700 (PDT)"  >Added to 2.0 branch</comment>
                </comments>
    
    <attachments>
            <attachment id="12333739" name="FTP.diffs" size="887" author="denisgaebler@netscape.net" created="Thu, 18 Aug 2005 21:40:29 -0700 (PDT)" />
            <attachment id="12333740" name="UnixFTPEntryParser.diffs" size="879" author="denisgaebler@netscape.net" created="Fri, 19 Aug 2005 22:20:14 -0700 (PDT)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>36258</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-77] [net] MVSFTPEntryParser setRawListing</title>
<link>http://issues.apache.org/jira/browse/NET-77</link>

                    <description>The MVSFTPEntryParser is not setting the raw listing in the FTPFile that it&lt;br/&gt;
creates. The toString on FTPFile returns this value which causes a NPE when&lt;br/&gt;
trying to list files via ant.

&lt;p&gt;Also it is creating an FTPFile for the header (&quot;Volume Unit...&quot;) that it&lt;br/&gt;
receives from the host. This also causes a problem with the list function in ant&lt;br/&gt;
because it receives 2 entries when requesting a listing for 1 file. Ant&lt;br/&gt;
(probably wrongfully) is just taking the first entry in the array that it&lt;br/&gt;
receives back so you never get your file names.&lt;/p&gt;

&lt;p&gt;The following code is how I got it to work...&lt;/p&gt;

&lt;p&gt;    private static final String HEADER = &quot;Volume Unit    Referred Ext Used Recfm&lt;br/&gt;
Lrecl BlkSz Dsorg Dsname&quot;;&lt;/p&gt;

&lt;p&gt;   ...&lt;/p&gt;

&lt;p&gt;    public FTPFile parseFTPEntry(String entry)&lt;br/&gt;
    {       &lt;br/&gt;
        FTPFile f = null;&lt;br/&gt;
        if (matches(entry) &amp;amp;&amp;amp; !entry.trim().equals(HEADER))          &lt;/p&gt;
        {
            f = new FTPFile();
            String dataSetName = group(2);
            f.setType(FTPFile.FILE_TYPE);
            f.setName(dataSetName);
            f.setRawListing(entry);
            return (f);
        }
&lt;p&gt;        return null;&lt;br/&gt;
    }&lt;/p&gt;</description>
                <environment>Operating System: Windows 2000&lt;br/&gt;
Platform: PC</environment>
            <key id="12342490">NET-77</key>
        <summary>[net] MVSFTPEntryParser setRawListing</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="dholst@shazam.net">Darrin Holst</reporter>
            
    <created>Thu, 18 Aug 2005 16:21:05 -0700 (PDT)</created>
    <updated>Tue, 19 Feb 2008 14:33:32 -0800 (PST)</updated>

                        <version>1.4</version>
            
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12570485" author="rwinston@eircom.net" created="Tue, 19 Feb 2008 14:33:32 -0800 (PST)"  >This parser has been rewritten for 2.0</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>36249</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-37] [net] listFiles() doesn&apos;t return anything if ftp server is configured in french</title>
<link>http://issues.apache.org/jira/browse/NET-37</link>

                    <description>the FTPClient.listFiles() method returns an empty FTPFile[] array if the FTP&lt;br/&gt;
server is localized in french. The output of an &quot;ls -l&quot; command is not the same&lt;br/&gt;
as in english

&lt;p&gt;french =&amp;gt; drwxrwxrwx   5 user      group             256 27 jul 14:48 toto&lt;br/&gt;
english =&amp;gt; drwxrwxrwx   5 user      group             256 Jul 27 14:48 toto&lt;/p&gt;

&lt;p&gt;The parser gets confused because of the date not being displayed in the same way&lt;br/&gt;
(&quot;27 jul&quot; vs &quot;Jul 27&quot;)&lt;/p&gt;</description>
                <environment>Operating System: other&lt;br/&gt;
Platform: Other</environment>
            <key id="12342413">NET-37</key>
        <summary>[net] listFiles() doesn&apos;t return anything if ftp server is configured in french</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="redshadowstar@yahoo.com">redshadowstar</reporter>
            
    <created>Thu, 28 Jul 2005 11:42:38 -0700 (PDT)</created>
    <updated>Wed, 19 Sep 2007 22:31:07 -0700 (PDT)</updated>

                
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12409931" author="scohen@apache.org" created="Fri, 29 Jul 2005 04:07:46 -0700 (PDT)"  >You don&apos;t specify your version.  If you aren&apos;t using the latest version, 1.4.0,&lt;br/&gt;
please get it.  If you are using 1.4.0, please see the documentation around the&lt;br/&gt;
class FTPClientConfig which offers a fix for your situation.  (You do have to do&lt;br/&gt;
a little extra work before calling listFiles, but you can now handle this,&lt;br/&gt;
whereas before you could not).</comment>
                    <comment id="12409932" author="redshadowstar@yahoo.com" created="Fri, 29 Jul 2005 09:06:34 -0700 (PDT)"  >
&lt;p&gt;(In reply to comment #1)&lt;br/&gt;
&amp;gt; You don&apos;t specify your version.  If you aren&apos;t using the latest version, 1.4.0,&lt;br/&gt;
&amp;gt; please get it.  If you are using 1.4.0, please see the documentation around the&lt;br/&gt;
&amp;gt; class FTPClientConfig which offers a fix for your situation.  (You do have to do&lt;br/&gt;
&amp;gt; a little extra work before calling listFiles, but you can now handle this,&lt;br/&gt;
&amp;gt; whereas before you could not).&lt;/p&gt;

&lt;p&gt;Ok I&apos;ll have a look at that (I&apos;m currently using 1.4.0). Thanks !&lt;/p&gt;</comment>
                    <comment id="12409933" author="redshadowstar@yahoo.com" created="Fri, 29 Jul 2005 12:20:54 -0700 (PDT)"  >Ok it works now (couldn&apos;t use the FTPClientConfig.setLanguageCode(&quot;fr&quot;) though,&lt;br/&gt;
because our FTP server is showing &quot;jul&quot; for July instead of &quot;jui&quot; as declared in&lt;br/&gt;
FTPClientConfig :

&lt;p&gt;// some don&apos;t&lt;br/&gt;
LANGUAGE_CODE_MAP.put(&quot;fr&quot;,&quot;jan|f\u00e9v|mar|avr|mai|jun|jui|ao\u00fb|sep|oct|nov|d\u00e9c&quot;);&lt;br/&gt;
 //french&lt;/p&gt;</comment>
                    <comment id="12409934" author="scohen@apache.org" created="Sat, 30 Jul 2005 04:29:00 -0700 (PDT)"  >Thanks for letting me know how it came out.  I assume you had to &quot;roll your own&quot;&lt;br/&gt;
month names string.  I would like to have made it more convenient but it seems&lt;br/&gt;
that this whole business of localized month names on ftp servers is rapidly&lt;br/&gt;
dying out.  I did a bit of research and never could find any publicly accessible&lt;br/&gt;
ftp sites that coded month names in any language other than English, regardless&lt;br/&gt;
of what language the site used in its text messages.  I assume that your site is&lt;br/&gt;
not publicly accessible either.  Please let me know if that is not the case.  

&lt;p&gt;I&apos;d recode the &quot;standard&quot; French month names to what you found to be the case,&lt;br/&gt;
but you are the very first user whose report I&apos;ve heard.  I have no idea whether&lt;br/&gt;
your situation is more &quot;standard&quot;.  The problem is there are no standards here,&lt;br/&gt;
which is why I made it so flexible.  By the way, out of curiosity where is this&lt;br/&gt;
ftp site: France, Quebec, some other place?&lt;/p&gt;</comment>
                    <comment id="12409935" author="redshadowstar@yahoo.com" created="Mon, 1 Aug 2005 09:56:51 -0700 (PDT)"  >You&apos;re right, I had to use my own name strings to make it work.&lt;br/&gt;
The server is in France, but it&apos;s not publicly accessible. For what I know (I&apos;m&lt;br/&gt;
not an administrator on the machine hosting the server), the FTP is the one&lt;br/&gt;
shipped with AIX 5.2 (5.2.0.0) and it shows as &quot;Version 4.1 Tue Jul 6 21:20:07&lt;br/&gt;
CDT 2004&quot; upon login. Here&apos;s the output of a &quot;locale -a&quot; :&lt;br/&gt;
C&lt;br/&gt;
POSIX&lt;br/&gt;
fr_FR.IBM-1252@euro&lt;br/&gt;
fr_FR.IBM-1252&lt;br/&gt;
fr_FR.IBM-1252@preeuro&lt;br/&gt;
fr_FR.8859-15&lt;br/&gt;
fr_FR.8859-15@preeuro&lt;br/&gt;
fr_FR.ISO8859-1&lt;br/&gt;
fr_FR.8859-15@euro&lt;br/&gt;
fr_FR

&lt;p&gt;As you said, hard to find any standard when it comes to language...&lt;/p&gt;</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>35912</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-63] [net] NTFTPEntryParser parses directory names starting with a number followed by space incorrectly.</title>
<link>http://issues.apache.org/jira/browse/NET-63</link>

                    <description>When I used FTPClient.listFiles() with MS FTP Server I found that directories with names starting with a &lt;br/&gt;
number followed by space being parsed incorrectly. But when I browse above-mentioned server with &lt;br/&gt;
Internet Explorer or with Total Commander&amp;rsquo;s built-in ftp client directory names are shown correctly.&lt;br/&gt;
Now look at the following failing test. (It should be added to NTFTPEntryParserTest class):

&lt;p&gt;    public void testDirectoryBeginningWithNumberFollowedBySpaces() throws Exception&lt;/p&gt;
    {
        FTPFile f = getParser().parseFTPEntry(&quot;12-03-96  06:38AM       &amp;lt;DIR&amp;gt;          123 xyz&quot;);
        assertEquals(&quot;name&quot;, &quot;123 xyz&quot;, f.getName());
    }

&lt;p&gt;Junit output:&lt;br/&gt;
&#133;&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt; name expected:&amp;lt;123 ...&amp;gt; but was:&amp;lt;...&amp;gt;&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt; junit.framework.ComparisonFailure: name expected:&amp;lt;123 ...&amp;gt; but was:&amp;lt;...&amp;gt;&lt;br/&gt;
&#133;&lt;/p&gt;

&lt;p&gt;The following patch fixes the problem:&lt;/p&gt;

&lt;p&gt;Index: jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java&lt;br/&gt;
===============================================================&lt;br/&gt;
====&lt;br/&gt;
RCS file: /home/cvspublic/jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/&lt;br/&gt;
NTFTPEntryParser.java,v&lt;br/&gt;
retrieving revision 1.19&lt;br/&gt;
diff -u -r1.19 NTFTPEntryParser.java&lt;br/&gt;
&amp;#8212; jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java&lt;br/&gt;
	2 Jan 2005 03:17:50 -0000	1.19&lt;br/&gt;
+++ jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java&lt;br/&gt;
	13 Jun 2005 17:26:16 -0000&lt;br/&gt;
@@ -39,8 +39,7 @@&lt;br/&gt;
      */&lt;br/&gt;
     private static final String REGEX =&lt;br/&gt;
         &quot;(\\S+)\\s+(\\S+)&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;+ &quot;(&amp;lt;DIR&amp;gt;)?&lt;br clear=&quot;all&quot; /&gt;s*&quot;&lt;/li&gt;
	&lt;li&gt;+ &quot;(&lt;span class=&quot;error&quot;&gt;&amp;#91;0-9&amp;#93;&lt;/span&gt;+)?&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+        + &quot;(?&lt;img class=&quot;emoticon&quot; src=&quot;https://issues.apache.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&amp;lt;DIR&amp;gt;)|(&lt;span class=&quot;error&quot;&gt;&amp;#91;0-9&amp;#93;&lt;/span&gt;+))&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
         + &quot;(&lt;br clear=&quot;all&quot; /&gt;S.*)&quot;;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;     /**&lt;/p&gt;</description>
                <environment>Operating System: All&lt;br/&gt;
Platform: All</environment>
            <key id="12342307">NET-63</key>
        <summary>[net] NTFTPEntryParser parses directory names starting with a number followed by space incorrectly.</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="gecko@yandex.ru">Sergey Smirnov</reporter>
            
    <created>Mon, 13 Jun 2005 19:29:52 -0700 (PDT)</created>
    <updated>Wed, 19 Sep 2007 22:31:11 -0700 (PDT)</updated>

                        <version>1.4</version>
            
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12409605" author="gecko@yandex.ru" created="Mon, 13 Jun 2005 19:55:56 -0700 (PDT)"  >Created an attachment (id=15390)&lt;br/&gt;
The same patch is written in my bug report.

&lt;p&gt;I&amp;rsquo;m sorry for inline patch in my bug report. It was first time when I used&lt;br/&gt;
bugzilla.&lt;/p&gt;</comment>
                    <comment id="12409606" author="gecko@yandex.ru" created="Mon, 13 Jun 2005 20:00:51 -0700 (PDT)"  >Created an attachment (id=15391)&lt;br/&gt;
Test to determine the bug.</comment>
                    <comment id="12409607" author="scohen@apache.org" created="Tue, 14 Jun 2005 13:08:26 -0700 (PDT)"  >I think your patch solves this problem (it correctly notes that we should expect&lt;br/&gt;
EITHER a &amp;lt;DIR&amp;gt; OR a number indicating size, not two optional fields) but I don&apos;t&lt;br/&gt;
think your patch goes far enough.  I think we need to solve for the fact that&lt;br/&gt;
there can be spaces anywhere within an NT filename.  123 xyz works, but how&lt;br/&gt;
about 123 abc xyz?</comment>
                    <comment id="12409608" author="scohen@apache.org" created="Tue, 14 Jun 2005 13:39:59 -0700 (PDT)"  >(In reply to comment #3)&lt;br/&gt;
&amp;gt; I think your patch solves this problem (it correctly notes that we should expect&lt;br/&gt;
&amp;gt; EITHER a &amp;lt;DIR&amp;gt; OR a number indicating size, not two optional fields) but I don&apos;t&lt;br/&gt;
&amp;gt; think your patch goes far enough.  I think we need to solve for the fact that&lt;br/&gt;
&amp;gt; there can be spaces anywhere within an NT filename.  123 xyz works, but how&lt;br/&gt;
&amp;gt; about 123 abc xyz?

&lt;p&gt;By the way, excuse my manners.  I should have thanked you for your patch. &lt;br/&gt;
You&apos;ve found a real problem.  The problem was just bigger than you thought it&lt;br/&gt;
was.  If you feel like it, please submit another patch that solves for all the&lt;br/&gt;
names-with-spaces cases and includes tests for them in the Test class and then I&lt;br/&gt;
will commit it.&lt;/p&gt;</comment>
                    <comment id="12409609" author="scohen@apache.org" created="Wed, 15 Jun 2005 06:19:30 -0700 (PDT)"  >Actually, there was nothing at all wrong with your patch.  The problem I had&lt;br/&gt;
thought existed did not, in fact, exist.  I should have read the regular&lt;br/&gt;
expression more carefully.

&lt;p&gt;I have committed your patch verbatim except that I added one more test assert to&lt;br/&gt;
prove that the scenario I had envisioned was not a problem.  Thanks again for&lt;br/&gt;
your patch.&lt;/p&gt;</comment>
                    <comment id="12409610" author="scohen@apache.org" created="Thu, 22 Dec 2005 01:15:08 -0800 (PST)"  >&lt;ul&gt;
	&lt;li&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;ul&gt;
			&lt;li&gt;COM-2655 has been marked as a duplicate of this bug. ***&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
</comment>
                </comments>
    
    <attachments>
            <attachment id="12333563" name="num-space-test.patch" size="1012" author="gecko@yandex.ru" created="Mon, 13 Jun 2005 20:00:51 -0700 (PDT)" />
            <attachment id="12333562" name="num-space.patch" size="795" author="gecko@yandex.ru" created="Mon, 13 Jun 2005 19:55:56 -0700 (PDT)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>35346</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-59] [net] NullpointerException on FTPClient.disconnect() if an Exception occured while FTPClient.connect</title>
<link>http://issues.apache.org/jira/browse/NET-59</link>

                    <description>Hello,

&lt;p&gt;think this bug is the same (or at least similiar) to the following one:&lt;br/&gt;
&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://issues.apache.org/bugzilla/show_bug.cgi?id=26296&quot;&gt;http://issues.apache.org/bugzilla/show_bug.cgi?id=26296&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;br/&gt;
but since I was not sure, I opened it as a seperate report.&lt;/p&gt;

&lt;p&gt;Versions affected: commons-net-1.2.2, think also commons-net-1.4.0&lt;/p&gt;

&lt;p&gt;Problem: If an exception occures while FTPClient.connect() is running, a call to &lt;br/&gt;
FTPClient.disconnect() in a finally-block might throw a NullPointerException.&lt;br/&gt;
I am pretty shure, that this might cause some Threads so keep alive, also they &lt;br/&gt;
cannot be interrupted anymore.&lt;/p&gt;

&lt;p&gt;Reason: This happens since TelnetClient.disconnect() does not check whether the &lt;br/&gt;
Streams (__input and __ouput) it tries to close are NULL or not.&lt;br/&gt;
Normally it is sufficent to check FTPClient.isConnected(), but if a exceptions &lt;br/&gt;
is thrown after SocketClient._&lt;em&gt;connectAction&lt;/em&gt; has been excecuted, SocketClient.&lt;br/&gt;
&lt;em&gt;isConnected&lt;/em&gt; is set to true, so the check will indicate that the connection is &lt;br/&gt;
alive.&lt;/p&gt;

&lt;p&gt;Christian&lt;/p&gt;</description>
                <environment>Operating System: All&lt;br/&gt;
Platform: Other</environment>
            <key id="12342280">NET-59</key>
        <summary>[net] NullpointerException on FTPClient.disconnect() if an Exception occured while FTPClient.connect</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="christian.hufgard@gmx.de">Christian Hufgard</reporter>
            
    <created>Thu, 2 Jun 2005 14:41:05 -0700 (PDT)</created>
    <updated>Wed, 20 Dec 2006 03:01:44 -0800 (PST)</updated>

                        <version>1.2</version>
            
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12459895" author="rwinston@eircom.net" created="Wed, 20 Dec 2006 03:01:44 -0800 (PST)"  >Added null check in TelnetClient</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>35185</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-83] [net] FTP timestamp: year recognition</title>
<link>http://issues.apache.org/jira/browse/NET-83</link>

                    <description>org.apache.commons.net.ftp.parser.FTPTimestampParserImpl

&lt;p&gt;public Calendar parseTimestamp(String timestampStr)&lt;br/&gt;
      :&lt;br/&gt;
    if (working.after(now)) {
        working.add(Calendar.YEAR, -1);
    }&lt;br/&gt;
&lt;br/&gt;
If system date of the remote machine is ahead of local machine, the code above&lt;br/&gt;
does not work well. For example, when the system date of local machine is five&lt;br/&gt;
minutes later than date of file at the remote machine, it is recognized as the&lt;br/&gt;
file a year ago.&lt;br/&gt;
&lt;br/&gt;
  LOCAL SYSDATE:Jun/02/2005 14:00&lt;br/&gt;
  File TimeStamp&lt;br/&gt;
    Jun/02 14:05 -&lt;del&gt;recognized as&lt;/del&gt;-&amp;gt; Jun/02/2004 14:05&lt;br/&gt;
&lt;br/&gt;
The date format is switched after six months, so I think that the code above&lt;br/&gt;
shuold be changed as following:&lt;br/&gt;
&lt;br/&gt;
    //    s  m  h  d half-year&lt;br/&gt;
    // 1000*60*60*24*183=15811200000ms&lt;br/&gt;
    long wkt = working.getTimeInMillis();&lt;br/&gt;
    long nwt = now.getTimeInMillis();&lt;br/&gt;
    if (wkt &amp;gt; (nwt+15811200000L)) {        working.add(Calendar.YEAR, -1);    } }&lt;/p&gt;</description>
                <environment>Operating System: All&lt;br/&gt;
Platform: All</environment>
            <key id="12342278">NET-83</key>
        <summary>[net] FTP timestamp: year recognition</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="ishigami@victokai.co.jp">Satoshi Ishigami</reporter>
            
    <created>Thu, 2 Jun 2005 10:26:24 -0700 (PDT)</created>
    <updated>Sun, 9 Mar 2008 15:43:53 -0700 (PDT)</updated>

                        <version>1.4</version>
            
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12409470" author="scohen@apache.org" created="Sat, 4 Jun 2005 01:02:22 -0700 (PDT)"  >Synchronize your machines if you&apos;re dealing in intervals this fine!

&lt;p&gt;How do you KNOW &quot;the date format is switched after six months&quot;?  Is that the way&lt;br/&gt;
your server does it?  The problem with FTP is that there is NO standard on these&lt;br/&gt;
matters.  On the other hand if you DO have some authoritative statement of what&lt;br/&gt;
you&apos;re saying, I&apos;d love to see it.  Please send it.&lt;/p&gt;

&lt;p&gt;Or, if timezone differences are the reason for your discrepancy, 1.4.0 offers a&lt;br/&gt;
way to handle it.  It&apos;s in the documentation.  See FTPClientConfig.&lt;/p&gt;</comment>
                    <comment id="12409471" author="scohen@apache.org" created="Sat, 4 Jun 2005 02:28:21 -0700 (PDT)"  >On further review &amp;#8211; you&apos;re right - or mostly so!

&lt;p&gt;I checked a few popular FTP servers (including several Apache mirrors) and all&lt;br/&gt;
seem to follow your pattern.  They show the year after six months.&lt;/p&gt;

&lt;p&gt;Then I looked back at earlier versions of our code.&lt;/p&gt;

&lt;p&gt;Prior to the introduction of&lt;br/&gt;
org.apache.commons.net.ftp.parser.FTPTimestampParserImpl, the default&lt;br/&gt;
implementation simply compared months.  If the month on the timestamp was&lt;br/&gt;
greater than the current month, it must be last year.  That was the test.  It&lt;br/&gt;
eliminates most &quot;slop&quot;.  I suppose it might fail when the current time is Jan 31&lt;br/&gt;
23:59:59 and file timestamp is Feb 1 00:00, but it basically gave the right&lt;br/&gt;
results except in these edge cases.&lt;/p&gt;

&lt;p&gt;The new code &quot;improved&quot; things by delegating to java.util.Date&apos;s &quot;simple&quot;&lt;br/&gt;
after() method but made matters worse in the &quot;slop&quot; case.&lt;/p&gt;

&lt;p&gt;Your suggestion probably works best of all, but I&apos;m still a little bothered by&lt;br/&gt;
the six month thing.  Suppose there is an FTP server that displays the time for&lt;br/&gt;
all files less than a year old - which is what the old code, written by Daniel&lt;br/&gt;
Savarese, seems to imply.  Then your code breaks there.&lt;/p&gt;

&lt;p&gt;Perhaps Daniel might like to chime in on how he remembers this?&lt;/p&gt;</comment>
                    <comment id="12409472" author="dfs@apache.org" created="Sun, 5 Jun 2005 04:58:42 -0700 (PDT)"  >I think sometimes the year would be missing for &lt;br/&gt;
  6 months ago &amp;lt; date &amp;lt; 12 months ago&lt;br/&gt;
but I can&apos;t be sure.  I dug up an archive of the original oroinc.com&lt;br/&gt;
CVS repository and looked through the log comments but couldn&apos;t come&lt;br/&gt;
up with anything definitive.  The looser test may have simply been&lt;br/&gt;
defensive programming. 1997 was oh so long ago.</comment>
                    <comment id="12409473" author="scohen@apache.org" created="Sun, 5 Jun 2005 14:23:44 -0700 (PDT)"  >OK - we&apos;re in uncharted waters here and I am not entirely sure what is the right&lt;br/&gt;
thing to do.

&lt;p&gt;Daniel Savarese, the original author of this code base does not remember the&lt;br/&gt;
reasons for his original code which was more tolerant but not completely so of&lt;br/&gt;
the client and server clocks being out of synch.&lt;/p&gt;

&lt;p&gt;The current implementation is more &quot;accurate&quot; but at the cost of being&lt;br/&gt;
completely intolerant of &quot;slop&quot;.&lt;/p&gt;

&lt;p&gt;I could for example, without too much trouble, recode this so that any server&lt;br/&gt;
timestamps that appear to be more than one day in the future be considered last&lt;br/&gt;
year.  That would handle this for all timezones in the world as well as slop,&lt;br/&gt;
and it may be the most faithful rendition of what appears to be Daniel&apos;s&lt;br/&gt;
original intent.  But I&apos;m still uncomfortable introducing inaccuracies to&lt;br/&gt;
account for slop, unless I can be reasonably sure it&apos;s harmless.&lt;/p&gt;

&lt;p&gt;Mr. Ishigami: I need more information from you.&lt;br/&gt;
1)  Can you tell me your exact use case?  Are you having this problem because&lt;br/&gt;
a) the clocks are out of synch and you could fix the problem&lt;br/&gt;
b) the clocks are out of synch but you can&apos;t do anything about it beacuse the&lt;br/&gt;
server is out of your control?&lt;br/&gt;
c) the server is in a different time zone from the client which you could handle&lt;br/&gt;
by using FTPClientConfig?&lt;/p&gt;

&lt;p&gt;2)  Please indicate whether you have any information other than observation that&lt;br/&gt;
says that the rollover from MMM dd HH:mm to MMM dd yyyy display occurs when a&lt;br/&gt;
file becomes six months old.&lt;/p&gt;

&lt;p&gt;Parenthetically, I&apos;ll note that this whole business is a powerful argument in&lt;br/&gt;
favor of those FTP servers, such as the one that Neeme Praks indicates is now&lt;br/&gt;
standard on Debian GNU Linux (not to mention Windows), which display all&lt;br/&gt;
timestamps as yyyy-MM-dd HH:mm, instead of making us guess.&lt;/p&gt;


















</comment>
                    <comment id="12409474" author="scohen@apache.org" created="Sun, 5 Jun 2005 14:30:06 -0700 (PDT)"  >(In reply to comment #4)

&lt;p&gt;&amp;gt; Parenthetically, I&apos;ll note that this whole business is a powerful argument in&lt;br/&gt;
&amp;gt; favor of those FTP servers, such as the one that Neeme Praks indicates is now&lt;br/&gt;
&amp;gt; standard on Debian GNU Linux (not to mention Windows), which display all&lt;br/&gt;
&amp;gt; timestamps as yyyy-MM-dd HH:mm, instead of making us guess.&lt;/p&gt;

&lt;p&gt;Out of curiosity, I took a look at some of Debian&apos;s FTP mirrors and it appears&lt;br/&gt;
they do not use their numeric format yet.&lt;/p&gt;
</comment>
                    <comment id="12409475" author="scohen@apache.org" created="Sun, 5 Jun 2005 22:45:09 -0700 (PDT)"  >(In reply to comment #4)&lt;br/&gt;
&amp;gt;&amp;gt; The current implementation is more &quot;accurate&quot; but at the cost of being&lt;br/&gt;
&amp;gt; completely intolerant of &quot;slop&quot;.&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; I could for example, without too much trouble, recode this so that any server&lt;br/&gt;
&amp;gt; timestamps that appear to be more than one day in the future be considered last&lt;br/&gt;
&amp;gt; year.  

&lt;p&gt;I have had a go at testing this idea.  It breaks our JUnit tests, but that&apos;s&lt;br/&gt;
just because the JUnit tests were written with a &quot;no-slop&quot; approach.  Since I&apos;m&lt;br/&gt;
having trouble deciding whether it&apos;s a good thing or a bad thing to allow for&lt;br/&gt;
&quot;slop&quot;, maybe that&apos;s a sign that we need a &quot;slop-mode&quot; option in FTPClientConfig&lt;br/&gt;
(probably named differently)?  Perhaps something similar to how&lt;br/&gt;
SimpleDateFormat.isLenient() exists because one size does not fit all?&lt;/p&gt;</comment>
                    <comment id="12409476" author="ishigami@victokai.co.jp" created="Mon, 6 Jun 2005 14:11:26 -0700 (PDT)"  >&amp;gt; 1)  Can you tell me your exact use case?  Are you having this problem because&lt;br/&gt;
&amp;gt; a) the clocks are out of synch and you could fix the problem&lt;br/&gt;
&amp;gt; b) the clocks are out of synch but you can&apos;t do anything about it beacuse the&lt;br/&gt;
&amp;gt; server is out of your control?&lt;br/&gt;
&amp;gt; c) the server is in a different time zone from the client which you could handle&lt;br/&gt;
&amp;gt; by using FTPClientConfig?

&lt;p&gt;b)&lt;/p&gt;

&lt;p&gt;In my case, two servers are running on same time zone and the clocks are out of&lt;br/&gt;
synch.&lt;/p&gt;

&lt;p&gt;I use the Commons Net for the purpose of B2B. In case of intranet, several&lt;br/&gt;
servers can synchronize clocks, for instance, by using time server. On the other&lt;br/&gt;
hand, in case of B2B (or internet), clocks are out of synch because each server&lt;br/&gt;
is controled under each organization. All organizations do not always do&lt;br/&gt;
synchronization. This says some server is out of my control.&lt;/p&gt;

&lt;p&gt;This problem is reporductable as following for my case:&lt;/p&gt;

&lt;p&gt; Server A=14:00 Server B=14:05&lt;br/&gt;
 1) create file on Server B (timestamp is 14:05)&lt;br/&gt;
 2) connect from Sercer A to Server B and execute LIST.&lt;/p&gt;

&lt;p&gt;I tried to quick-fix this problem to described code. But, I thought that this is&lt;br/&gt;
not only my problem, so I reported.&lt;/p&gt;


&lt;p&gt;&amp;gt; 2)  Please indicate whether you have any information other than observation&lt;br/&gt;
&amp;gt; that says that the rollover from MMM dd HH:mm to MMM dd yyyy display occurs&lt;br/&gt;
&amp;gt; when a file becomes six months old.&lt;/p&gt;

&lt;p&gt;Six month came from my observation. I do not have further information.&lt;br/&gt;
I check in my environments:&lt;/p&gt;

&lt;p&gt;  Solaris 9    FTP Server                     rollover six months.&lt;br/&gt;
  HP-UX 11.11  FTP server (Version 1.1.214.4) rollover six months.&lt;br/&gt;
  Tru64 UNIX   FTP server (Version 5.60)      rollover six months.&lt;br/&gt;
  RHL, ES3     vsFTPd 1.2.0                   rollover six months.&lt;br/&gt;
  Win2003      Microsoft FTP Service          rollover by year?&lt;/p&gt;

&lt;p&gt;I think that the problem is how long local server can accept when timestamp of&lt;br/&gt;
file on remote server is ahead of system date of local server: For a day, a week,&lt;br/&gt;
a month or a year?&lt;/p&gt;

&lt;p&gt;My suggestion is six months becase of observation above.&lt;/p&gt;</comment>
                    <comment id="12409477" author="dfs@apache.org" created="Mon, 6 Jun 2005 21:44:19 -0700 (PDT)"  >(In reply to comment #6)&lt;br/&gt;
&amp;gt; having trouble deciding whether it&apos;s a good thing or a bad thing to allow for&lt;br/&gt;
&amp;gt; &quot;slop&quot;, maybe that&apos;s a sign that we need a &quot;slop-mode&quot; option in FTPClientConfig&lt;br/&gt;
&amp;gt; (probably named differently)?  Perhaps something similar to how&lt;br/&gt;
&amp;gt; SimpleDateFormat.isLenient() exists because one size does not fit all?

&lt;p&gt;That sounds like a good compromise.  Every time we&apos;ve tried to impose&lt;br/&gt;
a single way to handle this sort of thing, we always seem to get bitten&lt;br/&gt;
by some special case (curse FTP and its unspecified listing output! &lt;img class=&quot;emoticon&quot; src=&quot;https://issues.apache.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;.&lt;br/&gt;
Letting the API user decide if he wants a looser &quot;slop&quot;-handling&lt;br/&gt;
interpretation of dates provides sufficient flexibility&lt;br/&gt;
for programmers to work around special cases without forcing the API&lt;br/&gt;
to be all-knowing.&lt;/p&gt;</comment>
                    <comment id="12409478" author="scohen@apache.org" created="Tue, 7 Jun 2005 01:20:42 -0700 (PDT)"  >A new method, FTPClientConfig.setLenientFutureDates() allows a &quot;slop&quot; factor of&lt;br/&gt;
one day, which sounds like it will fit with your use case.

&lt;p&gt;You&apos;ll have to get source from CVS or use nightly builds until this is released.&lt;/p&gt;</comment>
                </comments>
    
    <issuelinks>
                <issuelinktype id="10030">
            <name>Reference</name>
                            <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="12389468">NET-188</issuekey>
        </issuelink>
                    </outwardlinks>
                                </issuelinktype>
            </issuelinks>
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>35181</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-71] [net][PATCH] &quot;MVS is the operating system of this server. FTP Server is running on z/OS.&quot;</title>
<link>http://issues.apache.org/jira/browse/NET-71</link>

                    <description>Jeff Nadler created the original fix to this issue and I wrote the test case.  I&lt;br/&gt;
will post the patch directly.</description>
                <environment>Operating System: All&lt;br/&gt;
Platform: All</environment>
            <key id="12342167">NET-71</key>
        <summary>[net][PATCH] &quot;MVS is the operating system of this server. FTP Server is running on z/OS.&quot;</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="wnoto@openfinance.com">William Noto</reporter>
            
    <created>Thu, 7 Apr 2005 22:33:39 -0700 (PDT)</created>
    <updated>Wed, 19 Sep 2007 22:31:11 -0700 (PDT)</updated>

                        <version>Nightly Builds</version>
            
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12409055" author="wnoto@openfinance.com" created="Thu, 7 Apr 2005 22:34:27 -0700 (PDT)"  >Created an attachment (id=14649)&lt;br/&gt;
This fixes the MVS FTP issue.</comment>
                    <comment id="12409056" author="wnoto@openfinance.com" created="Thu, 7 Apr 2005 23:38:52 -0700 (PDT)"  >The attached patch fixes this.</comment>
                    <comment id="12409057" author="scohen@apache.org" created="Fri, 8 Apr 2005 03:23:16 -0700 (PDT)"  >This bug cannot be marked as fixed - your code has not yet been accepted into&lt;br/&gt;
the commons-net project yet.  However, I see no problem in its being accepted,&lt;br/&gt;
and when it is, this bug can close.</comment>
                    <comment id="12409058" author="scohen@apache.org" created="Fri, 8 Apr 2005 20:51:11 -0700 (PDT)"  >Now it can be called &quot;fixed&quot;.  I have committed your new parser to SVN and it is&lt;br/&gt;
part of the project.  Thank you both for your excellent contributions.  This is&lt;br/&gt;
how Open Source is supposed to work.  

&lt;p&gt;I made a couple of minor changes to your code so that it might fit better into&lt;br/&gt;
the hierarchy.  I made your parser class a subclass of&lt;br/&gt;
ConfigurableFTPFileEntryParserImpl (which may not have been around at the time&lt;br/&gt;
you originally wrote this) and I made your test class a subclass of&lt;br/&gt;
FTPParseTestFramework which is more appropriate than the original&lt;br/&gt;
CompositeFTPParseTestFramework (the latter is for parsers that are &quot;polymorphic&quot;&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;for example, NT&apos;s parser which can be configured either in the native NT&lt;br/&gt;
format or the UNIX format).&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;You guys might want to submit more patches if and when you get a chance, if you&lt;br/&gt;
learn any more about how timestamps and directories are handled.&lt;/p&gt;

&lt;p&gt;Again, thanks.&lt;/p&gt;</comment>
                    <comment id="12409059" author="scohen@apache.org" created="Sun, 17 Apr 2005 23:09:35 -0700 (PDT)"  >&lt;ul&gt;
	&lt;li&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;ul&gt;
			&lt;li&gt;COM-1438 has been marked as a duplicate of this bug. ***&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
</comment>
                </comments>
    
    <attachments>
            <attachment id="12333447" name="commons-net-MVSFTPEntryParser-patch.txt" size="10953" author="wnoto@openfinance.com" created="Thu, 7 Apr 2005 22:34:27 -0700 (PDT)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>34360</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-55] [net] NTP port parameter ignored</title>
<link>http://issues.apache.org/jira/browse/NET-55</link>

                    <description>The port parameter of the NTPUDPClient#getTime(java.net.InetAddress host, int &lt;br/&gt;
port) call is not regarded in the implementation. The default port (123) is &lt;br/&gt;
used regardless of which port number is given in the call.</description>
                <environment>Operating System: All&lt;br/&gt;
Platform: All</environment>
            <key id="12342144">NET-55</key>
        <summary>[net] NTP port parameter ignored</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="felix.eichhorn@3soft.de">Felix Eichhorn</reporter>
            
    <created>Tue, 29 Mar 2005 12:51:38 -0800 (PST)</created>
    <updated>Wed, 19 Sep 2007 22:31:10 -0700 (PDT)</updated>

                
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12408998" author="felix.eichhorn@3soft.de" created="Tue, 29 Mar 2005 12:56:26 -0800 (PST)"  >Created an attachment (id=14582)&lt;br/&gt;
Proposed patch for the NTP port bug.

&lt;p&gt;Just sets the port as given in the call on the DatagramPacket to be sent.&lt;/p&gt;</comment>
                    <comment id="12408999" author="rwinston@eircom.net" created="Fri, 15 Apr 2005 16:10:09 -0700 (PDT)"  >Patch applied. Thanks.</comment>
                </comments>
    
    <attachments>
            <attachment id="12333434" name="ntp port patch.txt" size="452" author="felix.eichhorn@3soft.de" created="Tue, 29 Mar 2005 12:56:26 -0800 (PST)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>34219</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-104] [net] POP3Client ProtocolCommandListener protocolReplyReceived method event.getMessage() is empty/blank</title>
<link>http://issues.apache.org/jira/browse/NET-104</link>

                    <description>Using POP3Client.addProtocolCommandListener, when the listener&apos;s&lt;br/&gt;
protocolReplyReceived method is called with a ProtocolCommandEvent object, the&lt;br/&gt;
getMessage() method of this object returns a blank string. It should return the&lt;br/&gt;
reply string. Caused by POP3.__getReply() calling the listener before it has&lt;br/&gt;
saved the reply string in _replyLines.

&lt;p&gt;Pseudocode example:&lt;/p&gt;

&lt;p&gt;public class TestPOP3 implements ProtocolCommandLister &lt;br/&gt;
{&lt;br/&gt;
	public void connect()&lt;/p&gt;
	{
				POP3Client client = new POP3Client();
				client.addProtocolCommandListener(this);
				client.connect(emailServer);
				client.login(emailUsername, emailPassword);
				client.disconnect();
	}
&lt;p&gt;	public void protocolCommandSent(ProtocolCommandEvent vent)&lt;/p&gt;
	{
		log.debug(&quot;&amp;gt;&quot; + event.getMessage());
	}
&lt;p&gt;	public void protocolReplyReceived(ProtocolCommandEvent vent)&lt;/p&gt;
	{
		// bug: event.getMessage() is always an empty string ere
		log.debug(&quot;&amp;lt;&quot; + event.getMessage());
	}
&lt;p&gt;}&lt;/p&gt;</description>
                <environment>Operating System: All&lt;br/&gt;
Platform: All</environment>
            <key id="12342129">NET-104</key>
        <summary>[net] POP3Client ProtocolCommandListener protocolReplyReceived method event.getMessage() is empty/blank</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="sammy_c@lineone.net">Dave Cee</reporter>
            
    <created>Tue, 22 Mar 2005 17:51:45 -0800 (PST)</created>
    <updated>Wed, 19 Sep 2007 22:31:16 -0700 (PDT)</updated>

                        <version>Nightly Builds</version>
            
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12408947" author="sammy_c@lineone.net" created="Tue, 22 Mar 2005 17:54:32 -0800 (PST)"  >Created an attachment (id=14536)&lt;br/&gt;
Suggested patch for POP3.java, diff on 1.3.0 source</comment>
                    <comment id="12408948" author="sammy_c@lineone.net" created="Tue, 22 Mar 2005 17:57:02 -0800 (PST)"  >(From update of attachment 14536)&lt;br/&gt;
&amp;gt;--- POP3.java	2005-03-22 16:39:31.974738700 +0000&lt;br/&gt;
&amp;gt;+++ POP3.java	2005-03-22 16:41:29.273405900 +0000&lt;br/&gt;
&amp;gt;@@ -124,11 +124,11 @@&lt;br/&gt;
&amp;gt;             MalformedServerReplyException(&lt;br/&gt;
&amp;gt;                 &quot;Received invalid POP3 protocol response from server.&quot;);&lt;br/&gt;
&amp;gt;&lt;br/&gt;
&amp;gt;-        if (&lt;em&gt;commandSupport&lt;/em&gt;.getListenerCount() &amp;gt; 0)&lt;br/&gt;
&amp;gt;-            &lt;em&gt;commandSupport&lt;/em&gt;.fireReplyReceived(_replyCode, getReplyString());&lt;br/&gt;
&amp;gt;-&lt;br/&gt;
&amp;gt;         _replyLines.addElement(line);&lt;br/&gt;
&amp;gt;         _lastReplyLine = line;&lt;br/&gt;
&amp;gt;+&lt;br/&gt;
&amp;gt;+        if (&lt;em&gt;commandSupport&lt;/em&gt;.getListenerCount() &amp;gt; 0)&lt;br/&gt;
&amp;gt;+            &lt;em&gt;commandSupport&lt;/em&gt;.fireReplyReceived(_replyCode, getReplyString());&lt;br/&gt;
&amp;gt;     }&lt;br/&gt;
&amp;gt;</comment>
                    <comment id="12408949" author="sammy_c@lineone.net" created="Tue, 22 Mar 2005 17:58:22 -0800 (PST)"  >(From update of attachment 14536)&lt;br/&gt;
&amp;gt;--- POP3.java	2005-03-22 16:39:31.974738700 +0000&lt;br/&gt;
&amp;gt;+++ POP3.java	2005-03-22 16:41:29.273405900 +0000&lt;br/&gt;
&amp;gt;@@ -124,11 +124,11 @@&lt;br/&gt;
&amp;gt;             MalformedServerReplyException(&lt;br/&gt;
&amp;gt;                 &quot;Received invalid POP3 protocol response from server.&quot;);&lt;br/&gt;
&amp;gt;&lt;br/&gt;
&amp;gt;-        if (&lt;em&gt;commandSupport&lt;/em&gt;.getListenerCount() &amp;gt; 0)&lt;br/&gt;
&amp;gt;-            &lt;em&gt;commandSupport&lt;/em&gt;.fireReplyReceived(_replyCode, getReplyString());&lt;br/&gt;
&amp;gt;-&lt;br/&gt;
&amp;gt;         _replyLines.addElement(line);&lt;br/&gt;
&amp;gt;         _lastReplyLine = line;&lt;br/&gt;
&amp;gt;+&lt;br/&gt;
&amp;gt;+        if (&lt;em&gt;commandSupport&lt;/em&gt;.getListenerCount() &amp;gt; 0)&lt;br/&gt;
&amp;gt;+            &lt;em&gt;commandSupport&lt;/em&gt;.fireReplyReceived(_replyCode, getReplyString());&lt;br/&gt;
&amp;gt;     }&lt;br/&gt;
&amp;gt;</comment>
                    <comment id="12408950" author="sammy_c@lineone.net" created="Tue, 22 Mar 2005 18:02:59 -0800 (PST)"  >Sorry, I&apos;m a Bugzilla newbie, ignore the comments about the edits of the patch file.</comment>
                    <comment id="12408951" author="dfs@apache.org" created="Tue, 22 Mar 2005 20:43:14 -0800 (PST)"  >Thanks.  I applied the fix.  Please verify before closing.</comment>
                </comments>
    
    <attachments>
            <attachment id="12333423" name="patch.txt" size="504" author="sammy_c@lineone.net" created="Tue, 22 Mar 2005 17:54:32 -0800 (PST)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>34133</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-105] [net] FTP Parsing off in Net Components for ACL</title>
<link>http://issues.apache.org/jira/browse/NET-105</link>

                    <description>If a directory has a access control list tied to it, when a directory listing is&lt;br/&gt;
spit out, a plus is appended onto the end of the permissions.  This causes&lt;br/&gt;
parsing of the file fails.  Below are two patches that solves this.  The first&lt;br/&gt;
is for the test file under&lt;br/&gt;
/net/trunk/src/test/org/apache/commons/net/ftp/parser/.  The second is the&lt;br/&gt;
actual parser that is under /net/trunk/src/java/org/apache/commons/net/ftp/parser.


&lt;p&gt;Index: UnixFTPEntryParserTest.java&lt;br/&gt;
===================================================================&lt;br/&gt;
&amp;#8212; UnixFTPEntryParserTest.java	(revision 155093)&lt;br/&gt;
+++ UnixFTPEntryParserTest.java	(working copy)&lt;br/&gt;
@@ -24,7 +24,7 @@&lt;/p&gt;

&lt;p&gt; /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@author &amp;lt;a href=&quot;mailto:scohen@apache.org&quot;&amp;gt;Steve Cohen&amp;lt;/a&amp;gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;* @version $Id: UnixFTPEntryParserTest.java,v 1.15 2004/09/14 01:47:17 scohen&lt;br/&gt;
Exp $&lt;br/&gt;
+ * @version $Id$&lt;br/&gt;
  */&lt;br/&gt;
 public class UnixFTPEntryParserTest extends FTPParseTestFramework&lt;br/&gt;
 {&lt;br/&gt;
@@ -45,6 +45,7 @@&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;     private static final String[] goodsamples =&lt;br/&gt;
     {
+
         &quot;-rw-r--r--   1 500      500            21 Aug  8 14:14 JB3-TES1.gz&quot;,
         &quot;-rwxr-xr-x   2 root     root         4096 Mar  2 15:13 zxbox&quot;,
         &quot;drwxr-xr-x   2 root     root         4096 Aug 24  2001 zxjdbc&quot;,
@@ -70,6 +71,8 @@
         &quot;-rwSr-Sr--   1 500      500             0 Mar 25 08:22 testSuid&quot;,
 		&quot;-rwsr-sr--   1 500      500             0 Mar 25 08:23 testSuidExec&quot;,
 		&quot;-rwsr-sr--   1 500      500             0 Mar 25 0:23 testSuidExec2&quot;,
+        &quot;drwxrwx---+ 23 500     500    0 Jan 10 13:09 testACL&quot;,
+
 		&quot;-rw-r--r--   1 1        3518644 May 25 12:12 std&quot;
     };&lt;/p&gt;


&lt;p&gt;Index: UnixFTPEntryParser.java&lt;br/&gt;
===================================================================&lt;br/&gt;
&amp;#8212; UnixFTPEntryParser.java	(revision 155093)&lt;br/&gt;
+++ UnixFTPEntryParser.java	(working copy)&lt;br/&gt;
@@ -26,7 +26,7 @@&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;This class is based on the logic of Daniel Savarese&apos;s&lt;/li&gt;
	&lt;li&gt;DefaultFTPListParser, but adapted to use regular expressions and to fit the&lt;/li&gt;
	&lt;li&gt;new FTPFileEntryParser interface.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;* @version $Id: UnixFTPEntryParser.java,v 1.21 2005/01/02 03:17:50 scohen Exp $&lt;br/&gt;
+ * @version $Id$&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;@see org.apache.commons.net.ftp.FTPFileEntryParser FTPFileEntryParser (for&lt;br/&gt;
usage instructions)&lt;br/&gt;
  */&lt;br/&gt;
 public class UnixFTPEntryParser extends ConfigurableFTPFileEntryParserImpl&lt;br/&gt;
@@ -65,7 +65,7 @@&lt;br/&gt;
      */&lt;br/&gt;
     private static final String REGEX =&lt;br/&gt;
         &quot;(&lt;span class=&quot;error&quot;&gt;&amp;#91;bcdlfmpSs-&amp;#93;&lt;/span&gt;)&quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;+&lt;br/&gt;
&quot;(((r|&lt;del&gt;)(w|&lt;/del&gt;)(&lt;span class=&quot;error&quot;&gt;&amp;#91;xsStTL-&amp;#93;&lt;/span&gt;))((r|&lt;del&gt;)(w|&lt;/del&gt;)(&lt;span class=&quot;error&quot;&gt;&amp;#91;xsStTL-&amp;#93;&lt;/span&gt;))((r|&lt;del&gt;)(w|&lt;/del&gt;)(&lt;span class=&quot;error&quot;&gt;&amp;#91;xsStTL-&amp;#93;&lt;/span&gt;)))&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+        +&lt;br/&gt;
&quot;(((r|&lt;del&gt;)(w|&lt;/del&gt;)(&lt;span class=&quot;error&quot;&gt;&amp;#91;xsStTL-&amp;#93;&lt;/span&gt;))((r|&lt;del&gt;)(w|&lt;/del&gt;)(&lt;span class=&quot;error&quot;&gt;&amp;#91;xsStTL-&amp;#93;&lt;/span&gt;))((r|&lt;del&gt;)(w|&lt;/del&gt;)(&lt;span class=&quot;error&quot;&gt;&amp;#91;xsStTL-&amp;#93;&lt;/span&gt;)))\\+?&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
         + &quot;(\\d+)&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
         + &quot;(\\S+)&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
         + &quot;(?&lt;img class=&quot;emoticon&quot; src=&quot;https://issues.apache.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;\\S+)&lt;br clear=&quot;all&quot; /&gt;s+)?&quot;&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment>Operating System: Windows XP&lt;br/&gt;
Platform: PC</environment>
            <key id="12342109">NET-105</key>
        <summary>[net] FTP Parsing off in Net Components for ACL</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="robertalasch@yahoo.com">Robert Lasch</reporter>
            
    <created>Fri, 11 Mar 2005 23:37:41 -0800 (PST)</created>
    <updated>Wed, 19 Sep 2007 22:31:16 -0700 (PDT)</updated>

                        <version>Nightly Builds</version>
            
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12408876" author="rwinston@eircom.net" created="Fri, 15 Apr 2005 16:08:31 -0700 (PDT)"  >Applied patch. Thanks.</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>33972</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-68] [net] TFTPClient&apos;s send file discards last ack</title>
<link>http://issues.apache.org/jira/browse/NET-68</link>

                    <description>TFTPClient reads all acks just fine except the last-one when sending a file. I&lt;br/&gt;
figured this out when I tried to use the same TFTPClient-instance for something&lt;br/&gt;
else (reading a file) after sending a file. This ack was next in the buffer and&lt;br/&gt;
some exception was thrown (don&apos;t remember which anymore). 

&lt;p&gt;I fixed this for myself using a flag (lastAckWait). Here is a the result of&lt;br/&gt;
diff-command:&lt;/p&gt;

&lt;p&gt;diff -u TFTPClient.java.original TFTPClient.java.patched&lt;br/&gt;
&amp;#8212; TFTPClient.java.original    2004-12-28 15:02:37.235997984 +0200&lt;br/&gt;
+++ TFTPClient.java.patched     2004-12-28 15:09:14.516602152 +0200&lt;br/&gt;
@@ -372,6 +372,7 @@&lt;/p&gt;

&lt;p&gt;         dataLength = lastBlock = hostPort = bytesRead = 0;&lt;br/&gt;
         block = 0;&lt;br/&gt;
+        boolean lastAckWait = false;&lt;/p&gt;

&lt;p&gt;         if (mode == TFTP.ASCII_MODE)&lt;br/&gt;
             input = new ToNetASCIIInputStream(input);&lt;br/&gt;
@@ -455,7 +456,10 @@&lt;br/&gt;
                         if (lastBlock == block)&lt;/p&gt;
                         {
                             ++block;
-                            break _receivePacket;
+                            if (lastAckWait)
+                              break _sendPacket;
+                            else
+                              break _receivePacket;
                         }
&lt;p&gt;                         else&lt;/p&gt;
                         {
@@ -501,9 +505,8 @@
             data.setData(_sendBuffer, 4, offset - 4);
             sent = data;
         }
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;while (dataLength == 0);&lt;br/&gt;
+        while (dataLength == 0 || lastAckWait);&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;bufferedSend(sent);&lt;br/&gt;
         endBufferedOps();&lt;br/&gt;
     }&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;By the way we have implemented a TFTP server also (heavily unit-tested). I could&lt;br/&gt;
try to contribute it back if it fits in commons net. There was some talk in the&lt;br/&gt;
web-pages of doing only client-side stuff for commons-net. &lt;/p&gt;

&lt;p&gt;-Perttu&lt;/p&gt;</description>
                <environment>Operating System: Linux&lt;br/&gt;
Platform: PC</environment>
            <key id="12341961">NET-68</key>
        <summary>[net] TFTPClient&apos;s send file discards last ack</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="perttu.auramo@ekahau.com">Perttu Auramo</reporter>
            
    <created>Tue, 28 Dec 2004 14:37:48 -0800 (PST)</created>
    <updated>Wed, 16 Jan 2008 16:36:11 -0800 (PST)</updated>

                        <version>1.3</version>
            
                        <fixVersion>2.0</fixVersion>
                    <fixVersion>1.5</fixVersion>
            
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12408407" author="perttu.auramo@ekahau.com" created="Tue, 28 Dec 2004 14:39:53 -0800 (PST)"  >Created an attachment (id=13845)&lt;br/&gt;
The patch as a file</comment>
                    <comment id="12408408" author="rwinston@eircom.net" created="Fri, 15 Apr 2005 16:21:10 -0700 (PDT)"  >Thanks Perttu. </comment>
                    <comment id="12408409" author="michael.enright@gmail.com" created="Fri, 27 May 2005 02:32:43 -0700 (PDT)"  >I can&apos;t see how the flag in this patch helps anything. As far as I can tell, all&lt;br/&gt;
the lines in the patch that could make use of this new flag have + in front of&lt;br/&gt;
them. None of those lines set the flag to true, so the flag is always false and&lt;br/&gt;
the code pretty much does what it did before.

&lt;p&gt;There is another delta in the patch that changes how bufferedSend is called.&lt;br/&gt;
This worries me because I&apos;m having a problem where the last piece of the file&lt;br/&gt;
(or all of the file if it is small) is not sent to the server.&lt;/p&gt;</comment>
                    <comment id="12408410" author="michael.enright@gmail.com" created="Fri, 27 May 2005 02:58:57 -0700 (PDT)"  >FWIW restoring the deleted call to bufferedSend corrected the symptoms I had.</comment>
                    <comment id="12408411" author="dfs@apache.org" created="Fri, 27 May 2005 03:49:21 -0700 (PDT)"  >I concur with your assessment Michael.  I don&apos;t see what this patch does&lt;br/&gt;
other than break TFTPClient.sendFile.  Even if lastAckWait were true, the&lt;br/&gt;
method would go into an infinite loop at the end.  I&apos;m going to revert the&lt;br/&gt;
change.

&lt;p&gt;If the original issue reporter believes there is a bug in sendFile, then&lt;br/&gt;
we&apos;re going to need a test program that reproduces the bug.  Submitting&lt;br/&gt;
a patch with only anectdotal support for there being a problem is&lt;br/&gt;
insufficient.&lt;/p&gt;</comment>
                    <comment id="12408412" author="dfs@apache.org" created="Fri, 27 May 2005 04:12:23 -0700 (PDT)"  >It is true that sendFile doesn&apos;t wait for a final ack (probably because&lt;br/&gt;
it was thought at the time that we didn&apos;t want to hang if the final ack&lt;br/&gt;
got lost).  Therefore, a UDP packet may remain queued for delivery to&lt;br/&gt;
user space, causing a problem on subsequent read operation on the same&lt;br/&gt;
socket.  However, a call to TFTP.discardPackets is the appropriate&lt;br/&gt;
(although imperfect if the last ack is delayed) workaround until we get&lt;br/&gt;
more information about the problem.</comment>
                    <comment id="12408413" author="dfs@apache.org" created="Tue, 28 Jun 2005 21:04:23 -0700 (PDT)"  >&lt;ul&gt;
	&lt;li&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;ul&gt;
			&lt;li&gt;COM-2188 has been marked as a duplicate of this bug. ***&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    <comment id="12430869" author="rwinston@eircom.net" created="Sun, 27 Aug 2006 08:14:59 -0700 (PDT)"  >Daniel has reverted the fix.</comment>
                    <comment id="12436885" author="jhodgdon" created="Fri, 22 Sep 2006 08:31:39 -0700 (PDT)"  >Neither the 1.41 release version of TFTPClient.java, nor the current nightly build version (as of Sept 15 2006) is working, actually. This bug is still happening. I will attach a zip file (which I just mistakenly put into Bugzilla, sorry!) with some test code.

&lt;p&gt;The nightly build version is definitely doing what the bug report stated: dropping the last ACK. When TFTPClient sends a file, it sends a data packet and waits for an ACK, but after the last data packet, it doesn&apos;t pick up the last ACK, and then when TFTPClient goes to send/receive another file from the same server, the first thing it gets is the last ACK from the previous send, and it reports an &quot;unexpected packet received&quot; and fails.&lt;/p&gt;

&lt;p&gt;The version from the 1.41 release doesn&apos;t work either &amp;#8211; I can&apos;t recall exactly what is wrong with it, actually, but I tested it and it does not work.&lt;/p&gt;

&lt;p&gt;The version I will attach does work. It would probably be a good idea to use something like this in the next release.&lt;/p&gt;

&lt;p&gt;I&apos;ll also attach my test code: a TFTPClientApp and TFTPServerApp that can be run on two different computers to test the workings of the TFTPClient class.&lt;/p&gt;</comment>
                    <comment id="12436887" author="jhodgdon" created="Fri, 22 Sep 2006 08:33:19 -0700 (PDT)"  >This zip file contains a fix for TFTPClient.java, as well as TFTP test code. TFTPClientApp and TFTPServerApp need to be run on two separate computers &amp;#8211; see embedded doc for more information.</comment>
                    <comment id="12436895" author="jhodgdon" created="Fri, 22 Sep 2006 08:52:31 -0700 (PDT)"  >Patch for suggested fix to TFTPClient.java</comment>
                    <comment id="12448992" author="rwinston@eircom.net" created="Sat, 11 Nov 2006 08:08:21 -0800 (PST)"  >I&apos;ve applied your patch to TFTPClient on the 2.0 branch. Thanks Jennifer.</comment>
                    <comment id="12559761" author="armbrust" created="Wed, 16 Jan 2008 16:32:00 -0800 (PST)"  >Why hasn&apos;t this patch been applied to 1.4?  What good does it do fixing in in 2.0, if that never gets built?

&lt;p&gt;The 1.4 release, currently available for download is quite simply, broken.  Files smaller than 1 block size simply aren&apos;t transferred, larger files are corrupted.&lt;/p&gt;</comment>
                </comments>
    
    <issuelinks>
                <issuelinktype id="10032">
            <name>Blocker</name>
                                        <inwardlinks description="is blocked by">
                            <issuelink>
            <issuekey id="12370119">NET-161</issuekey>
        </issuelink>
                    </inwardlinks>
                    </issuelinktype>
            </issuelinks>
    <attachments>
            <attachment id="12341409" name="lastack.patch" size="4053" author="jhodgdon" created="Fri, 22 Sep 2006 08:52:31 -0700 (PDT)" />
            <attachment id="12333300" name="patch" size="1107" author="perttu.auramo@ekahau.com" created="Tue, 28 Dec 2004 14:39:53 -0800 (PST)" />
            <attachment id="12341406" name="TFTPstuff.zip" size="9453" author="jhodgdon" created="Fri, 22 Sep 2006 08:33:19 -0700 (PDT)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>32859</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-22] [net] FTP component: FTPFile does not initialize miliseconds correctly</title>
<link>http://issues.apache.org/jira/browse/NET-22</link>

                    <description>Hi, I have been working with the FTP utilities and was saving the filename and &lt;br/&gt;
lastModifiedTime (as taken from FTPFile.lastModifiedTime()) and had a problem &lt;br/&gt;
where I would query a directory, save those two parameters for each of the &lt;br/&gt;
files, then later on query the same directory (which in my test case has not &lt;br/&gt;
changed any) and I would find that the FTPFile.lastModifiedTime() objects did &lt;br/&gt;
not match. 

&lt;p&gt;In looking furthur into it I found that the calendar objects returned by this &lt;br/&gt;
function were off by a some random number of milliseconds, however it looked &lt;br/&gt;
like the hour, minutes, and all other times of the calendar were correct, it &lt;br/&gt;
was only the milliseconds.&lt;/p&gt;

&lt;p&gt;Drilling furthur into the source code for the Commons FTP components I think I &lt;br/&gt;
see what was overlooked to cause this condition.&lt;/p&gt;

&lt;p&gt;In version 1.2.2 if you look at the UnixFTPEntryParser.java source (I believe &lt;br/&gt;
this is the parser being used for my WSFTP server I am running, you can &lt;br/&gt;
download this ftp server from download.com, I am using this for my development &lt;br/&gt;
environment), looking on line 185 you have the following code:&lt;/p&gt;

&lt;p&gt;            Calendar cal = Calendar.getInstance();&lt;br/&gt;
            cal.set(Calendar.SECOND, 0);&lt;br/&gt;
            cal.set(Calendar.MINUTE, 0);&lt;br/&gt;
            cal.set(Calendar.HOUR_OF_DAY, 0);&lt;/p&gt;

&lt;p&gt;I see that you are initially creating a new calendar instance, which, by &lt;br/&gt;
default sets the calendar to the current time. Then you update the seconds, &lt;br/&gt;
minutes, and hour of dat, however you are not initializing the miliseconds, &lt;br/&gt;
hence the miliseconds vary between different instantiations of the same ftp &lt;br/&gt;
entry.  This causes the Calendar.equals() function to indicate that the two &lt;br/&gt;
times are different, though they should be equal.&lt;/p&gt;

&lt;p&gt;If you add:&lt;br/&gt;
            cal.set(Calendar.MILLISECOND, 0);&lt;/p&gt;

&lt;p&gt;I think you eliminate this problem.&lt;/p&gt;

&lt;p&gt;Best regards,&lt;br/&gt;
David&lt;/p&gt;</description>
                <environment>Operating System: All&lt;br/&gt;
Platform: All</environment>
            <key id="12341928">NET-22</key>
        <summary>[net] FTP component: FTPFile does not initialize miliseconds correctly</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="davidparks21@yahoo.com">David Parks</reporter>
            
    <created>Fri, 10 Dec 2004 01:39:18 -0800 (PST)</created>
    <updated>Wed, 19 Sep 2007 22:31:05 -0700 (PDT)</updated>

                        <version>1.2</version>
            
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12408300" author="rwinston@eircom.net" created="Fri, 10 Dec 2004 11:10:26 -0800 (PST)"  >Hi David,

&lt;p&gt;This issue is currently fixed in CVS and will be available in the 1.3.0 release&lt;br/&gt;
of Commons-Net (due to be released next week).&lt;/p&gt;</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>32623</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-5] [net] FTP Parser will fail with localized directory listings</title>
<link>http://issues.apache.org/jira/browse/NET-5</link>

                    <description>Various parsers in the org.apache.commons.net.ftp.parser package assume english abbreviations for &lt;br/&gt;
months; such as &lt;br/&gt;
    private static final String MONTHS =&lt;br/&gt;
	&quot;(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)&quot;;

&lt;p&gt;However, some server return localized versions of the above such as Okt for October in German.&lt;/p&gt;</description>
                <environment>Operating System: All&lt;br/&gt;
Platform: All</environment>
            <key id="12341921">NET-5</key>
        <summary>[net] FTP Parser will fail with localized directory listings</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="dkocher@sudo.ch">David Kocher</reporter>
            
    <created>Tue, 7 Dec 2004 15:51:10 -0800 (PST)</created>
    <updated>Wed, 19 Sep 2007 22:31:02 -0700 (PDT)</updated>

                
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12408252" author="rwinston@eircom.net" created="Wed, 8 Dec 2004 08:38:21 -0800 (PST)"  >This is an issue that has come up a few times before. Apart from the month&lt;br/&gt;
naming issue, there are other issues that can occur with l10n, like date&lt;br/&gt;
formatting, etc. This is something that will be tackled for the next version of&lt;br/&gt;
Commons::Net (1.4)</comment>
                    <comment id="12408253" author="rwinston@eircom.net" created="Mon, 13 Dec 2004 16:44:51 -0800 (PST)"  >&lt;ul&gt;
	&lt;li&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;ul&gt;
			&lt;li&gt;COM-1792 has been marked as a duplicate of this bug. ***&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    <comment id="12408254" author="scohen@apache.org" created="Sun, 2 Jan 2005 17:05:55 -0800 (PST)"  >I have just uploaded new functionality that makes it possible to get around&lt;br/&gt;
these limitations.  Documentation on their use is in the javadocs of the new&lt;br/&gt;
file org.apache.commons.net.ftp.FTPClientConfig.java.

&lt;p&gt;These enhancements badly need real-world testing.  If anyone can supply the URLs&lt;br/&gt;
of publicly accessible FTP sites that use non-English languages, date formats,&lt;br/&gt;
or time zones, please let us know and we will do this testing.&lt;/p&gt;</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>32565</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-79] extra byte in WRQ TFTP packet</title>
<link>http://issues.apache.org/jira/browse/NET-79</link>

                    <description>I obeserved that each tftp &quot;write request&quot; packet had two bytes with value x00&lt;br/&gt;
at the end of the packet.&lt;br/&gt;
e.g: 00 02 2f 6d 69 62 2f 63 6f 6e 66 69 67 00 6e 65 74 61 73 63 69 69 00 00 

&lt;p&gt;My tftp server (tftp4java) rejects this type WRQ packets.&lt;br/&gt;
I checked the RFC1350 and there I found:&lt;/p&gt;

&lt;p&gt;          2 bytes    string   1 byte     string   1 byte&lt;br/&gt;
          -----------------------------------------------&lt;br/&gt;
   RRQ/  | 01/02 |  Filename  |   0  |    Mode    |   0  |&lt;br/&gt;
   WRQ    -----------------------------------------------&lt;/p&gt;


&lt;p&gt;Gerard.&lt;/p&gt;</description>
                <environment>Operating System: All&lt;br/&gt;
Platform: All</environment>
            <key id="12341889">NET-79</key>
        <summary>extra byte in WRQ TFTP packet</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="gerard.dens@alcatel.be">Gerard Dens</reporter>
            
    <created>Tue, 23 Nov 2004 18:16:59 -0800 (PST)</created>
    <updated>Wed, 19 Sep 2007 22:31:12 -0700 (PDT)</updated>

                        <version>1.2</version>
            
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12408150" author="rwinston@eircom.net" created="Wed, 24 Nov 2004 10:16:54 -0800 (PST)"  >The problem here seems to be that the TFTP client in Commons::Net was built&lt;br/&gt;
based on TFTP version 1 (RFC 783), whereas the version you are using is version&lt;br/&gt;
2 (RFC 1350). Not being familiar with TFTP, I don&apos;t know what the major&lt;br/&gt;
differences are between the protocols here. If you are able to send a patch,&lt;br/&gt;
that would be great &lt;img class=&quot;emoticon&quot; src=&quot;https://issues.apache.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;. Otherwise, we can put TFTP2 support on the TODO list,&lt;br/&gt;
if there is enough demand.</comment>
                    <comment id="12408151" author="rwinston@eircom.net" created="Wed, 24 Nov 2004 10:36:47 -0800 (PST)"  >Now that I have actually looked at &lt;b&gt;both&lt;/b&gt; RFCs &lt;img class=&quot;emoticon&quot; src=&quot;https://issues.apache.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; I can see that there should&lt;br/&gt;
be no change in the basic WRQ packet format from RFC 783 (on which the&lt;br/&gt;
Commons::Net TFTP support is based):

&lt;p&gt;            2 bytes     string    1 byte     string   1 byte&lt;br/&gt;
            ------------------------------------------------&lt;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Opcode &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  Filename  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   0  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    Mode    &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   0  &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;            ------------------------------------------------&lt;/p&gt;

&lt;p&gt;To RFC 1350:&lt;/p&gt;

&lt;p&gt;            2 bytes     string    1 byte     string   1 byte&lt;br/&gt;
            ------------------------------------------------&lt;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Opcode &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  Filename  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   0  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    Mode    &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   0  &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;            ------------------------------------------------&lt;/p&gt;

&lt;p&gt;Have you tried with other RFC1350-compliant TFTP servers?&lt;/p&gt;</comment>
                    <comment id="12408152" author="rwinston@eircom.net" created="Wed, 24 Nov 2004 11:48:40 -0800 (PST)"  >I&apos;ve tried some TFTP examples with a couple of other servers, and it works fine.&lt;br/&gt;
I&apos;m going to mark this as WORKSFORME for now, unless you can prove that the&lt;br/&gt;
problem is with Commons::Net specifically. Cheers.</comment>
                    <comment id="12408153" author="francois.duchatelet@skynet.be" created="Wed, 24 Nov 2004 13:23:25 -0800 (PST)"  >The bug lies in the fact that Commons::Net adds an extraneous 0 byte after the &lt;br/&gt;
MODE string.&lt;br/&gt;
So it is interpreted by the server as an empty option.

&lt;p&gt;Culprit: TFTPRequestPacket.java, line 194:&lt;br/&gt;
        datagram.setLength(fileLength + modeLength + 4);&lt;/p&gt;

&lt;p&gt;Where the 4 is 2 bytes for the type field and 2 times 1 terminating null byte.&lt;br/&gt;
But, modeLength already accounted for this null byte.&lt;/p&gt;

&lt;p&gt;Then the packet is 1 byte too long, and this byte is interpreted as an empty &lt;br/&gt;
TFTPv2 option. &lt;/p&gt;

&lt;p&gt;Code should be:&lt;br/&gt;
        datagram.setLength(fileLength + modeLength + 3);&lt;/p&gt;

&lt;p&gt;Cheers,&lt;/p&gt;

&lt;p&gt;Fran&#231;ois&lt;/p&gt;</comment>
                    <comment id="12408154" author="rwinston@eircom.net" created="Wed, 24 Nov 2004 15:37:27 -0800 (PST)"  >Thank you for the comment. I&apos;ve changed, tested on an old TFTP server, and&lt;br/&gt;
committed.</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>32363</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-67] [net] Problem calculating total article count</title>
<link>http://issues.apache.org/jira/browse/NET-67</link>

                    <description>I am using Commons Net 1.2.2

&lt;p&gt;When you ask for the list of newsgroups of a NNTP Server, the framework doesn&apos;t&lt;br/&gt;
calculate correctly the total article count when that specific newsgroup has no&lt;br/&gt;
articles.&lt;/p&gt;

&lt;p&gt;For example, the NNTP Server answers something like this:&lt;/p&gt;

&lt;p&gt;  org.javahispano.j2ee 0 0 y&lt;/p&gt;

&lt;p&gt;then, debugging the source code of class:&lt;/p&gt;

&lt;p&gt;  org.apache.commons.net.nntp.NNTPClient&lt;/p&gt;

&lt;p&gt;I found the problem in method:&lt;/p&gt;

&lt;p&gt;  private NewsgroupInfo __parseNewsgroupListEntry(String entry)&lt;/p&gt;

&lt;p&gt;where it does:&lt;/p&gt;

&lt;p&gt;  ...&lt;br/&gt;
  result._setNewsgroup(tokenizer.nextToken());&lt;br/&gt;
  last = tokenizer.nextToken();&lt;br/&gt;
  first = tokenizer.nextToken();&lt;br/&gt;
  permission = tokenizer.nextToken();&lt;/p&gt;

&lt;p&gt;  try&lt;/p&gt;
  {
    lastNum = Integer.parseInt(last);
    firstNum = Integer.parseInt(first);
    result._setFirstArticle(firstNum);
    result._setLastArticle(lastNum);
    result._setArticleCount(lastNum - firstNum + 1);
  }
&lt;p&gt;  catch (NumberFormatException e)&lt;/p&gt;
  {
    return null;
  }

&lt;p&gt;The proble is in this line:&lt;/p&gt;

&lt;p&gt;  result._setArticleCount(lastNum - firstNum + 1);&lt;/p&gt;

&lt;p&gt;where if lastNum is 0 and firstNum is 0, it sais that the newsgroup has 1&lt;br/&gt;
article. I understand the code should add a control line where it double check&lt;br/&gt;
if lastNum and firstNum are 0. Right?&lt;/p&gt;</description>
                <environment>Operating System: All&lt;br/&gt;
Platform: All</environment>
            <key id="12341864">NET-67</key>
        <summary>[net] Problem calculating total article count</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="chemi">Jose M. Ordax</reporter>
            
    <created>Wed, 10 Nov 2004 13:45:57 -0800 (PST)</created>
    <updated>Wed, 19 Sep 2007 22:31:11 -0700 (PDT)</updated>

                        <version>1.2</version>
            
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12408012" author="rwinston@eircom.net" created="Fri, 26 Nov 2004 10:41:01 -0800 (PST)"  >You&apos;re right, I will put a check for that condition in there. Thanks.</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>32152</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-69] UnixFTPEntryParser.java fails to properly set MILLISECONDS field on FTPFile</title>
<link>http://issues.apache.org/jira/browse/NET-69</link>

                    <description>&lt;span class=&quot;error&quot;&gt;&amp;#91;This defect may affect other parsers too -- I haven&amp;#39;t checked.&amp;#93;&lt;/span&gt;

&lt;p&gt;On listings returned from UNIX FTP servers, only the hour and minute of the&lt;br/&gt;
modification time of a given FTPFile is shown. UnixFTPEntryParser.java does the&lt;br/&gt;
following when encountering such a listing:&lt;/p&gt;


&lt;p&gt;            Calendar cal = Calendar.getInstance();&lt;br/&gt;
            cal.set(Calendar.SECOND, 0);&lt;br/&gt;
            cal.set(Calendar.MINUTE, 0);&lt;br/&gt;
            cal.set(Calendar.HOUR_OF_DAY, 0);&lt;/p&gt;

&lt;p&gt;            try&lt;br/&gt;
            {&lt;br/&gt;
                int pos = MONTHS.indexOf(mo);&lt;br/&gt;
                int month = pos / 4;&lt;/p&gt;

&lt;p&gt;                if (null != yr)&lt;/p&gt;
                {
                    // it&apos;s a year
                    cal.set(Calendar.YEAR, Integer.parseInt(yr));
                }
&lt;p&gt;                else&lt;br/&gt;
                {&lt;br/&gt;
                    // it must be  hour/minute or we wouldn&apos;t have matched&lt;br/&gt;
                    int year = cal.get(Calendar.YEAR);&lt;br/&gt;
                    // if the month we&apos;re reading is greater than now, it must&lt;br/&gt;
                    // be last year&lt;br/&gt;
                    if (cal.get(Calendar.MONTH) &amp;lt; month)&lt;/p&gt;
                    {
                        year--;
                    }
&lt;p&gt;                    cal.set(Calendar.YEAR, year);&lt;br/&gt;
                    cal.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hr));&lt;br/&gt;
                    cal.set(Calendar.MINUTE, Integer.parseInt(min));&lt;br/&gt;
                }&lt;br/&gt;
                cal.set(Calendar.MONTH, month);&lt;/p&gt;

&lt;p&gt;                cal.set(Calendar.DATE, Integer.parseInt(da));&lt;br/&gt;
                file.setTimestamp(cal);&lt;/p&gt;

&lt;p&gt;Unfortunately, the code does not properly set the MILLISECOND field of the&lt;br/&gt;
original Calendar object. This means the MILLISECOND field is dependent upon the&lt;br/&gt;
system time that the object is actually created. Therefore, the FTPFile&apos;s&lt;br/&gt;
timestamp is wrong.&lt;/p&gt;

&lt;p&gt;I propose that the above code be patched to add a cal.set(Calendar.MILLISECOND, 0);&lt;/p&gt;</description>
                <environment>Operating System: other&lt;br/&gt;
Platform: All</environment>
            <key id="12341849">NET-69</key>
        <summary>UnixFTPEntryParser.java fails to properly set MILLISECONDS field on FTPFile</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="jdunn@nm.cbc.ca">Julian C. Dunn</reporter>
            
    <created>Wed, 3 Nov 2004 00:24:27 -0800 (PST)</created>
    <updated>Wed, 19 Sep 2007 22:31:11 -0700 (PDT)</updated>

                        <version>Nightly Builds</version>
            
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12407949" author="jdunn@nm.cbc.ca" created="Wed, 3 Nov 2004 00:25:13 -0800 (PST)"  >Created an attachment (id=13318)&lt;br/&gt;
UnixFTPEntryParser patch to set MILLISECONDS on Calendar object</comment>
                    <comment id="12407950" author="rwinston@eircom.net" created="Tue, 23 Nov 2004 13:52:47 -0800 (PST)"  >Committed. Thanks.</comment>
                </comments>
    
    <attachments>
            <attachment id="12333211" name="UnixFTPEntryParser.java.patch" size="450" author="jdunn@nm.cbc.ca" created="Wed, 3 Nov 2004 00:25:13 -0800 (PST)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>32034</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-6] FTPClient.listFiles method returns null for some files</title>
<link>http://issues.apache.org/jira/browse/NET-6</link>

                    <description>There&apos;s problem in regullar expression in class &lt;br/&gt;
org.apache.commons.net.ftp.parser.UnixFTPEntryParser which causes that files &lt;br/&gt;
with lastmodified attribute from 0 to 1 a.m. are not listed by ftpclient &lt;br/&gt;
listFiles method.

&lt;p&gt;Example:&lt;br/&gt;
This file is listed correctly:&lt;br/&gt;
-rwxrwxrwx 1 owner group 5127 Sep 24 11:44 somefile_tst_200409192_v105_breq.xml&lt;br/&gt;
For this, listFiles method returns null:&lt;br/&gt;
-rwxrwxrwx 1 owner group 5127 Sep 20 0:32 somefile_tst_200409192_v101_breq.xml&lt;/p&gt;


&lt;p&gt;Problem seems to be in:&lt;br/&gt;
private static final String REGEX =&lt;br/&gt;
&quot;(&lt;span class=&quot;error&quot;&gt;&amp;#91;bcdlfmpSs-&amp;#93;&lt;/span&gt;)&quot;&lt;br/&gt;
+ &quot;(((r|&lt;del&gt;)(w|&lt;/del&gt;)(&lt;span class=&quot;error&quot;&gt;&amp;#91;xsStTL-&amp;#93;&lt;/span&gt;))((r|&lt;del&gt;)(w|&lt;/del&gt;)(&lt;span class=&quot;error&quot;&gt;&amp;#91;xsStTL-&amp;#93;&lt;/span&gt;))((r|&lt;del&gt;)(w|&lt;/del&gt;)(&lt;span class=&quot;error&quot;&gt;&amp;#91;xsStTL-&amp;#93;&lt;/span&gt;)))&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+ &quot;(\\d+)&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+ &quot;(\\S+)&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+ &quot;(?&lt;img class=&quot;emoticon&quot; src=&quot;https://issues.apache.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;\\S+)&lt;br clear=&quot;all&quot; /&gt;s+)?&quot;&lt;br/&gt;
+ &quot;(\\d+)&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+ MONTHS + &quot;&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+ &quot;((?:&lt;span class=&quot;error&quot;&gt;&amp;#91;0-9&amp;#93;&lt;/span&gt;)|(?:&lt;span class=&quot;error&quot;&gt;&amp;#91;0-2&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0-9&amp;#93;&lt;/span&gt;)|(?:3&lt;span class=&quot;error&quot;&gt;&amp;#91;0-1&amp;#93;&lt;/span&gt;))&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+ &quot;((\\d\\d\\d\\d)|((?:&lt;span class=&quot;error&quot;&gt;&amp;#91;01&amp;#93;&lt;/span&gt;\\d)|(?:2&lt;span class=&quot;error&quot;&gt;&amp;#91;0123&amp;#93;&lt;/span&gt;)|(?:&lt;span class=&quot;error&quot;&gt;&amp;#91;1-9&amp;#93;&lt;/span&gt;)):(&lt;span class=&quot;error&quot;&gt;&amp;#91;012345&amp;#93;&lt;/span&gt;\\d))&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+ &quot;(\\S+)(&lt;br clear=&quot;all&quot; /&gt;s*.*)&quot;;&lt;/p&gt;

&lt;p&gt;where correct expression should be like this (0 insted of 1):&lt;/p&gt;

&lt;p&gt;private static final String REGEX =&lt;br/&gt;
&quot;(&lt;span class=&quot;error&quot;&gt;&amp;#91;bcdlfmpSs-&amp;#93;&lt;/span&gt;)&quot;&lt;br/&gt;
+ &quot;(((r|&lt;del&gt;)(w|&lt;/del&gt;)(&lt;span class=&quot;error&quot;&gt;&amp;#91;xsStTL-&amp;#93;&lt;/span&gt;))((r|&lt;del&gt;)(w|&lt;/del&gt;)(&lt;span class=&quot;error&quot;&gt;&amp;#91;xsStTL-&amp;#93;&lt;/span&gt;))((r|&lt;del&gt;)(w|&lt;/del&gt;)(&lt;span class=&quot;error&quot;&gt;&amp;#91;xsStTL-&amp;#93;&lt;/span&gt;)))&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+ &quot;(\\d+)&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+ &quot;(\\S+)&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+ &quot;(?&lt;img class=&quot;emoticon&quot; src=&quot;https://issues.apache.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;\\S+)&lt;br clear=&quot;all&quot; /&gt;s+)?&quot;&lt;br/&gt;
+ &quot;(\\d+)&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+ MONTHS + &quot;&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+ &quot;((?:&lt;span class=&quot;error&quot;&gt;&amp;#91;0-9&amp;#93;&lt;/span&gt;)|(?:&lt;span class=&quot;error&quot;&gt;&amp;#91;0-2&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0-9&amp;#93;&lt;/span&gt;)|(?:3&lt;span class=&quot;error&quot;&gt;&amp;#91;0-1&amp;#93;&lt;/span&gt;))&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+ &quot;((\\d\\d\\d\\d)|((?:&lt;span class=&quot;error&quot;&gt;&amp;#91;01&amp;#93;&lt;/span&gt;\\d)|(?:2&lt;span class=&quot;error&quot;&gt;&amp;#91;0123&amp;#93;&lt;/span&gt;)|(?:&lt;span class=&quot;error&quot;&gt;&amp;#91;0-9&amp;#93;&lt;/span&gt;)):(&lt;span class=&quot;error&quot;&gt;&amp;#91;012345&amp;#93;&lt;/span&gt;\\d))&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+ &quot;(\\S+)(&lt;br clear=&quot;all&quot; /&gt;s*.*)&quot;;&lt;/p&gt;</description>
                <environment>Operating System: Windows XP&lt;br/&gt;
Platform: PC</environment>
            <key id="12341781">NET-6</key>
        <summary>FTPClient.listFiles method returns null for some files</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="mjandik@centrum.cz">Martin Jand&#195;&#173;k</reporter>
            
    <created>Wed, 6 Oct 2004 11:28:37 -0700 (PDT)</created>
    <updated>Wed, 19 Sep 2007 22:31:02 -0700 (PDT)</updated>

                
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12407730" author="rwinston@eircom.net" created="Tue, 23 Nov 2004 14:13:33 -0800 (PST)"  >I&apos;ve just tried your example listing and it works fine. I note, however, that&lt;br/&gt;
the regex you supplied is not the same as the regex in CVS HEAD - I think that&lt;br/&gt;
this problem may have been fixed by someone else. Marking as FIXED, please&lt;br/&gt;
re-open  if you find any issues.</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>31560</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-1] commons-net 1.2.2 does not compile with JDK 1.5</title>
<link>http://issues.apache.org/jira/browse/NET-1</link>

                    <description>It uses &apos;enum&apos; which is a restricted keyword in JDK 1.5; you have to compile it&lt;br/&gt;
with -source 1.4. I will attach a patch</description>
                <environment>Operating System: other&lt;br/&gt;
Platform: Other</environment>
            <key id="12341767">NET-1</key>
        <summary>commons-net 1.2.2 does not compile with JDK 1.5</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="k.huwig.apache@huwig.de">Kurt Huwig</reporter>
            
    <created>Sun, 3 Oct 2004 11:29:42 -0700 (PDT)</created>
    <updated>Wed, 19 Sep 2007 22:31:01 -0700 (PDT)</updated>

                        <version>1.2</version>
            
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12407688" author="k.huwig.apache@huwig.de" created="Sun, 3 Oct 2004 11:30:34 -0700 (PDT)"  >Created an attachment (id=12923)&lt;br/&gt;
Patch to allow commons-net to compile using JDK 1.5</comment>
                    <comment id="12407689" author="dfs@apache.org" created="Tue, 5 Oct 2004 17:42:24 -0700 (PDT)"  >I changed all variables named enum to en.</comment>
                </comments>
    
    <attachments>
            <attachment id="12333139" name="jdk-1.5.diff" size="549" author="k.huwig.apache@huwig.de" created="Sun, 3 Oct 2004 11:30:34 -0700 (PDT)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>31516</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-52] TFTPClient.setMaxTimeouts() param check broken</title>
<link>http://issues.apache.org/jira/browse/NET-52</link>

                    <description>The input check on this method inspects the instance variable it is &lt;br/&gt;
going to set not the input received.

&lt;p&gt;Index: TFTPClient.java&lt;br/&gt;
===================================================================&lt;br/&gt;
RCS file: /home/cvspublic/jakarta-commons/net/src/java/org/apache/commons/net/&lt;br/&gt;
tftp/TFTPClient.java,v&lt;br/&gt;
retrieving revision 1.14&lt;br/&gt;
diff -u -r1.14 TFTPClient.java&lt;br/&gt;
&amp;#8212; TFTPClient.java	29 Jun 2004 04:54:31 -0000	1.14&lt;br/&gt;
+++ TFTPClient.java	23 Sep 2004 13:55:24 -0000&lt;br/&gt;
@@ -86,7 +86,7 @@&lt;br/&gt;
      ***/&lt;br/&gt;
     public void setMaxTimeouts(int numTimeouts)&lt;br/&gt;
     {&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;if (__maxTimeouts &amp;lt; 1)&lt;br/&gt;
+        if (numTimeouts &amp;lt; 1)&lt;br/&gt;
             __maxTimeouts = 1;&lt;br/&gt;
         else&lt;br/&gt;
             __maxTimeouts = numTimeouts;&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment>Operating System: All&lt;br/&gt;
Platform: All</environment>
            <key id="12341745">NET-52</key>
        <summary>TFTPClient.setMaxTimeouts() param check broken</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="steve@widge.net">Steve Weiland</reporter>
            
    <created>Thu, 23 Sep 2004 14:25:38 -0700 (PDT)</created>
    <updated>Wed, 19 Sep 2007 22:31:09 -0700 (PDT)</updated>

                        <version>Nightly Builds</version>
            
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12407634" author="rwinston@eircom.net" created="Thu, 23 Sep 2004 14:34:55 -0700 (PDT)"  >Fixed in CVS. Thanks.</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>31387</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-100] TelnetInputStream zombie thread memory leak, FTPClient TelnetClient</title>
<link>http://issues.apache.org/jira/browse/NET-100</link>

                    <description>If myFTPClient.setReaderThread(false) and many ftp clients are instanciated &lt;br/&gt;
over time, the VM gets out of memory errors. The problem is that the underlying &lt;br/&gt;
TelnetClient&apos;s TelnetInputStream creates a new thread that it never uses (never &lt;br/&gt;
starts, or joins). The VM is unable to garbage collect these zombie threads. &lt;br/&gt;
This problem is paticularly notable given that several users have observed &lt;br/&gt;
hangs doing continual ftp unless setReaderThread(false). This observed on hpux &lt;br/&gt;
jdk 1.3 &amp;lt;todo lookup specific version&amp;gt;

&lt;p&gt;Here&apos;s a patch:&lt;/p&gt;

&lt;p&gt;cvs server: Diffing src/java/org/apache/commons/net/telnet&lt;br/&gt;
Index: src/java/org/apache/commons/net/telnet/TelnetClient.java&lt;br/&gt;
===================================================================&lt;br/&gt;
RCS file: /home/cvspublic/jakarta-&lt;br/&gt;
commons/net/src/java/org/apache/commons/net/telnet/TelnetClient.java,v&lt;br/&gt;
retrieving revision 1.12&lt;br/&gt;
diff -r1.12 TelnetClient.java&lt;br/&gt;
100,101c100&lt;br/&gt;
&amp;lt; &lt;br/&gt;
&amp;lt;         tmp = new TelnetInputStream(input, this);&lt;br/&gt;
&amp;#8212;&lt;br/&gt;
&amp;gt;         tmp = new TelnetInputStream(input, this, readerThread);&lt;br/&gt;
Index: src/java/org/apache/commons/net/telnet/TelnetInputStream.java&lt;br/&gt;
===================================================================&lt;br/&gt;
RCS file: /home/cvspublic/jakarta-&lt;br/&gt;
commons/net/src/java/org/apache/commons/net/telnet/TelnetInputStream.java,v&lt;br/&gt;
retrieving revision 1.11&lt;br/&gt;
diff -r1.11 TelnetInputStream.java&lt;br/&gt;
56c56&lt;br/&gt;
&amp;lt;     TelnetInputStream(InputStream input, TelnetClient client)&lt;br/&gt;
&amp;#8212;&lt;br/&gt;
&amp;gt;     TelnetInputStream(InputStream input, TelnetClient client, boolean &lt;br/&gt;
readerThread)&lt;br/&gt;
72c72,74&lt;br/&gt;
&amp;lt;         __thread = new Thread(this);&lt;br/&gt;
&amp;#8212;&lt;br/&gt;
&amp;gt;         if (readerThread) {
&amp;gt;             __thread = new Thread(this);
&amp;gt;         }&lt;br/&gt;
76a79&lt;br/&gt;
&amp;gt;         if (__thread==null) { return; }&lt;br/&gt;
498c501&lt;br/&gt;
&amp;lt;             if (__thread.isAlive())&lt;br/&gt;
&amp;#8212;&lt;br/&gt;
&amp;gt;             if (__thread!=null &amp;amp;&amp;amp; __thread.isAlive())&lt;/p&gt;</description>
                <environment>Operating System: HP-UX&lt;br/&gt;
Platform: HP</environment>
            <key id="12341727">NET-100</key>
        <summary>TelnetInputStream zombie thread memory leak, FTPClient TelnetClient</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="code@markj.net">Mark Johnson</reporter>
            
    <created>Fri, 17 Sep 2004 08:05:00 -0700 (PDT)</created>
    <updated>Tue, 16 May 2006 05:20:40 -0700 (PDT)</updated>

                        <version>Nightly Builds</version>
            
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12407574" author="code@markj.net" created="Fri, 17 Sep 2004 08:47:31 -0700 (PDT)"  >observed on: java version &quot;JavaVM-1.3.0.00&quot;&lt;br/&gt;
Java(TM) 2 Runtime Environment, Standard Edition (build jinteg:11/28/00-11:08)&lt;br/&gt;
HotSpot VM (build 1.0.1fcs jinteg:11/28/00-13:54 PA2.0, mixed mode)</comment>
                    <comment id="12407575" author="dfs@apache.org" created="Fri, 24 Sep 2004 05:07:51 -0700 (PDT)"  >Bruno was responsible for adding setReaderThread, so I was kind of hoping&lt;br/&gt;
he&apos;d chime in and look at this.  However, it&apos;s pretty clear from looking&lt;br/&gt;
at the code that he overlooked what happens with TelnetInputStream, so I&apos;m&lt;br/&gt;
applying your fix.  Please verify it has the desired effect before closing.&lt;br/&gt;
I can&apos;t wait until we get rid of TelnetInputStream and TelnetOutputStream&lt;br/&gt;
once and for all.</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>31272</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-30] FTPClient deals badly with adverse network conditions</title>
<link>http://issues.apache.org/jira/browse/NET-30</link>

                    <description>We are attempting to use the FTPClient included in commons-net 1.2.2 to write &lt;br/&gt;
an application which has to deal with various outages: 
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;connection closed by server, without 421 warning&lt;/li&gt;
	&lt;li&gt;connection frozen&lt;/li&gt;
	&lt;li&gt;server temporarily unreachable&lt;/li&gt;
	&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;However, it appears that in most of these cases, FTPClient becomes easily &lt;br/&gt;
confused: &lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;If the connection is closed without warning, FTPClient doesn&apos;t notice at&lt;br/&gt;
first: ftp.isConnected() still returns true. However, when attempting to use &lt;br/&gt;
such a closed connection, we do get the correct exception &lt;br/&gt;
(FTPConnectionClosedException), at least most of the time (occasionnally we do &lt;br/&gt;
get various SocketExceptions instead) &lt;/li&gt;
	&lt;li&gt;If the ftp server doesn&apos;t respond in time, FTPClient hangs forever, even&lt;br/&gt;
after the ftp server responds eventually &lt;/li&gt;
	&lt;li&gt;If setSoTimeout is set, and if the server doesn&apos;t respond, the following&lt;br/&gt;
behaviour happens: 
	&lt;ul&gt;
		&lt;li&gt;if the server becomes responsive again before the timeout happens, the&lt;br/&gt;
client hangs until the timeout then receives SocketTimeoutException exception. &lt;br/&gt;
We would prefer if the client just continued normally (as the server did &lt;br/&gt;
respond before timeout) &lt;/li&gt;
		&lt;li&gt;if on the other hand the server does not become responsive when the timeout&lt;br/&gt;
happens, the client won&apos;t get any exception when timeout expires. Instead it &lt;br/&gt;
will just hang. As soon as the server gets responsive again (i.e. &lt;em&gt;after&lt;/em&gt; the &lt;br/&gt;
timeout had expired), the client immediately get the exception. We would prefer &lt;br/&gt;
if the client got the exception at the timeout, rather than long afterwards.&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment>Operating System: Linux&lt;br/&gt;
Platform: PC</environment>
            <key id="12341706">NET-30</key>
        <summary>FTPClient deals badly with adverse network conditions</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="apache@misc.lka.org.lu">Alain Knaff</reporter>
            
    <created>Wed, 8 Sep 2004 16:18:28 -0700 (PDT)</created>
    <updated>Wed, 19 Sep 2007 22:25:04 -0700 (PDT)</updated>

                
                
                
            <due></due>
    
            <votes>2</votes>
    
                                        

            <comments>
                    <comment id="12407503" author="apache@misc.lka.org.lu" created="Thu, 9 Sep 2004 15:25:26 -0700 (PDT)"  >Some small corrections: 
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Problem number 2 and 3 (&quot;hang&quot; if ftp server responds slowly, badly timed&lt;br/&gt;
SocketTimeout exceptions) was actually due to an artifact of vsftpd that we &lt;br/&gt;
used for testing. Please disregard these item, sorry for the confusion. &lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;However the following point still stands: &lt;br/&gt;
1. ftp.isConnected() does not notice that connection has been closed &lt;/p&gt;

&lt;p&gt;Additionnally, there are 2 new points: &lt;/p&gt;

&lt;p&gt;4. The timeout set by setSoTimeout misfires if the &lt;em&gt;client&lt;/em&gt; hasn&apos;t submitted a &lt;br/&gt;
request for a while. Probably some internal thread is waiting permanently for &lt;br/&gt;
server &quot;responses&quot; even if the client didn&apos;t send the server anything to &lt;br/&gt;
respond to. IMHO, timeout should only be triggered if an &lt;em&gt;expected&lt;/em&gt; response &lt;br/&gt;
doesn&apos;t come. &lt;br/&gt;
5. There apparently is no way of setting a timeout for the initial connection &lt;br/&gt;
request. Even setDefaultTimeout doesn&apos;t work for completely that purpose, as &lt;br/&gt;
can be easily checked by attempting to connect to an unreachable IP address. &lt;/p&gt;
</comment>
                    <comment id="12407504" author="apache@misc.lka.org.lu" created="Thu, 9 Sep 2004 17:22:47 -0700 (PDT)"  >One additional note: 

&lt;p&gt;Point #4 (misfiring of soTimeout if client is idle) can be avoided by calling &lt;br/&gt;
ftpclient.setReaderThread(false). Might be appropriate though to mention this &lt;br/&gt;
in the javadoc, in the description of setSoTimeout() and setDefaultTimeout() &lt;/p&gt;
</comment>
                    <comment id="12407505" author="dfs@apache.org" created="Thu, 9 Sep 2004 18:29:22 -0700 (PDT)"  >Regarding 1, isConnected is not supposed to notice if a connection has&lt;br/&gt;
terminated abnormally.  It is intended that one catch an exception in&lt;br/&gt;
such a case.

&lt;p&gt;4. The socket timeout is exactly that.  If there&apos;s no activity on a socket&lt;br/&gt;
for a given amount of time, it times out.  The timeout happens in the&lt;br/&gt;
TCP stack and java sets both SO_SNDTIMEO and SO_RCVTIMEO.&lt;/p&gt;

&lt;p&gt;5. setDefaultTimeout is merely the socket timeout to set after a connection&lt;br/&gt;
is established.  There is no support for connection timeouts prior to J2SE 1.4,&lt;br/&gt;
but Commons Net 1.2 is supposed to be J2SE 1.2 compatbile.  If you want to&lt;br/&gt;
set a connection timeout, you can create a socket factory as described in:&lt;br/&gt;
&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://www.mail-archive.com/commons-user@jakarta.apache.org/msg07716.html&quot;&gt;http://www.mail-archive.com/commons-user@jakarta.apache.org/msg07716.html&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</comment>
                    <comment id="12407506" author="dfs@apache.org" created="Thu, 9 Sep 2004 18:37:48 -0700 (PDT)"  >Re: setReaderThread&lt;br/&gt;
I didn&apos;t know we had such a method.  It looks like it was added here:&lt;br/&gt;
&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://cvs.apache.org/viewcvs.cgi/jakarta-commons/net/src/java/org/apache/commons/net/telnet/TelnetClient.java?rev=1.9&amp;amp;view=markup&quot;&gt;http://cvs.apache.org/viewcvs.cgi/jakarta-commons/net/src/java/org/apache/commons/net/telnet/TelnetClient.java?rev=1.9&amp;amp;view=markup&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://issues.apache.org/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;

&lt;p&gt;Other than adding documentation to FTPClient about this, it sounds like&lt;br/&gt;
like there isn&apos;t any other action to take on this report???&lt;/p&gt;</comment>
                    <comment id="12407507" author="apache@misc.lka.org.lu" created="Thu, 9 Sep 2004 20:22:16 -0700 (PDT)"  >Indeed, if point #1 (ftp.isConnected()) is the intended behavior, and if #5 &lt;br/&gt;
(connect timeout) cannot be addressed in JDK 1.2, then the only action left is &lt;br/&gt;
indeed #4, i.e. a documentation fix. 

&lt;p&gt;Or maybe, it could be fixed in the code by testing __readIsWaiting in &lt;br/&gt;
TelnetInputStream.run():  if __readIsWaiting is not set when the &lt;br/&gt;
InterruptedIOException occurs, just loop around without storing it into &lt;br/&gt;
_&lt;em&gt;ioException. That way it would work both in __threaded and non-&lt;/em&gt;_threaded &lt;br/&gt;
mode. The difficulty however for such a fix would be the border cases, such as &lt;br/&gt;
for example the situation where a user-level read() happens when the timeout &lt;br/&gt;
is already half expired, leaving only half to go. Maybe something could be &lt;br/&gt;
done by recording the start times of run&apos;s read() and of the user-level &lt;br/&gt;
read(), and dynamically adjusting the soTimeout? &lt;/p&gt;
</comment>
                    <comment id="12407508" author="dfs@apache.org" created="Thu, 9 Sep 2004 21:45:32 -0700 (PDT)"  >The root of the problem is the nasty telnet code.  As I indicated on&lt;br/&gt;
commons-dev in response to a related issue:&lt;br/&gt;
  I think the long term solution&lt;br/&gt;
  should be to branch, leaving the 1.2 series as J2SE 1.2 and 1.3 compatible,&lt;br/&gt;
  and reimplement telnet using selectable I/O in a single thread on the&lt;br/&gt;
  head branch; or start a new 2.0 branch either as a branch or in the&lt;br/&gt;
  sandbox as commons-net2, since everything would have to be overhauled&lt;br/&gt;
  once we start using java.nio.&lt;br/&gt;
Basically, I think we&apos;re seeing enough user demand that we should contemplate&lt;br/&gt;
the move to J2SE 1.4, even if we have to maintain two separate branches&lt;br/&gt;
(although I prefer the commons-net2 approach).  I think we&apos;ve taken&lt;br/&gt;
incremental patching as far as we can.

&lt;p&gt;On a separate note, the whole isConnected behavior issue needs to be&lt;br/&gt;
sorted out in a 2.0 version.  There has been enough of an expectation&lt;br/&gt;
from users as far as FTPClient is concerned for it to report the&lt;br/&gt;
current state of the underlying socket.  Previous to J2SE 1.4, it&lt;br/&gt;
was not possible to to test that state.  But Socket.isConnected&lt;br/&gt;
and SocketChannel.isConnected were added in J2SE 1.4, so that is&lt;br/&gt;
what a future SocketClient.isConnected should return.  Keep in mind&lt;br/&gt;
that you should be able to subclass FTPClient and override isConnected&lt;br/&gt;
if you&apos;re using J2SE 1.4 to return Socket.isConnected (I think).&lt;/p&gt;</comment>
                    <comment id="12407509" author="rwinston@eircom.net" created="Fri, 24 Sep 2004 12:12:09 -0700 (PDT)"  >I inserted a a short note and a link in the Javadoc to this thread. Will close&lt;br/&gt;
for now.</comment>
                    <comment id="12528981" author="bayard" created="Wed, 19 Sep 2007 22:25:04 -0700 (PDT)"  >Reclosing so it gets marked as Fixed. Jira migration bug.</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>31122</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-36] [net] PATCH] FTP and FTPClient changes</title>
<link>http://issues.apache.org/jira/browse/NET-36</link>

                    <description>I&apos;ve included 3 patch files for changes I&apos;ve made to the FTP andFTPClient&lt;br/&gt;
classes in the commons-net package.

&lt;p&gt;The first patch is for the FTP class making it extend SocketClientinstead of&lt;br/&gt;
TelnetClient. I noticed that the behavior of theTelnetClient&apos;s input stream&lt;br/&gt;
reader thread was effectively ignoring thesocket&apos;s SOTimeout causing reads to&lt;br/&gt;
hang forever if the server decidednot to respond to a client request at all.&lt;br/&gt;
This should also answer oneof the goals from the TODO list:&lt;/p&gt;

&lt;p&gt;&quot;Divorce FTPClient from TelnetClient, getting rid of the TelnetClientthreads&lt;br/&gt;
which cause problems on some platforms (e.g., MacOS).&quot;&lt;/p&gt;

&lt;p&gt;The second patch is for an FTPTest unit test. I&apos;ve covered most of thebasic&lt;br/&gt;
methods (connect(), disconnect(), sendCommand(), getReplyCode(),etc). Ignored&lt;br/&gt;
for now are the convenience methods since they all callsendCommand() underneath.&lt;br/&gt;
Part of the FTPTest class is a DummyFTPServerinner class which is used to&lt;br/&gt;
communicate to the test FTP class - don&apos;tknow if that would be useful elsewhere&lt;br/&gt;
(maybe part of FTPClient unittests), so you might consider making it a utility&lt;br/&gt;
class for other unittests.&lt;/p&gt;

&lt;p&gt;Finally I&apos;ve attached a patch for minor changes to FTPClient:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;changed __storeFile() from private to protected so that it can beused by&lt;br/&gt;
classes that extend FTPClient&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;added __storeFile(String, String) method - so that the commands itaccepts are&lt;br/&gt;
not limited to what&apos;s found in FTPCommand. Note: the__storeFile(int, String)&lt;br/&gt;
method now calls the __storeFile(String,String) method.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;added &lt;em&gt;openDataConnection&lt;/em&gt;(String, String) method - so that thecommands it&lt;br/&gt;
accepts are not limited to what&apos;s found in FTPCommand. Note:the&lt;br/&gt;
&lt;em&gt;openDataConnection&lt;/em&gt;(int, String) method now calls&lt;br/&gt;
the_openDataConnection_(String, String) method.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Hopefully you&apos;ll find the changes agreeable and will incorporate theminto the&lt;br/&gt;
code base.&lt;/p&gt;</description>
                <environment>Operating System: other&lt;br/&gt;
Platform: Other</environment>
            <key id="12341677">NET-36</key>
        <summary>[net] PATCH] FTP and FTPClient changes</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="jhindsley@providerlink.com">Joseph Hindsley</reporter>
            
    <created>Tue, 31 Aug 2004 19:25:26 -0700 (PDT)</created>
    <updated>Sat, 8 Mar 2008 11:38:50 -0800 (PST)</updated>

                        <version>1.2</version>
            
                        <fixVersion>2.0</fixVersion>
            
                
            <due></due>
    
            <votes>1</votes>
    
                                        

            <comments>
                    <comment id="12407407" author="jhindsley@providerlink.com" created="Tue, 31 Aug 2004 19:26:23 -0700 (PDT)"  >Created an attachment (id=12581)&lt;br/&gt;
FTP.java.patch.txt</comment>
                    <comment id="12407408" author="jhindsley@providerlink.com" created="Tue, 31 Aug 2004 19:26:46 -0700 (PDT)"  >Created an attachment (id=12582)&lt;br/&gt;
FTPTest.java.patch.txt</comment>
                    <comment id="12407409" author="jhindsley@providerlink.com" created="Tue, 31 Aug 2004 19:27:11 -0700 (PDT)"  >Created an attachment (id=12583)&lt;br/&gt;
FTPTest.java.patch.txt</comment>
                    <comment id="12407410" author="jhindsley@providerlink.com" created="Tue, 31 Aug 2004 19:28:34 -0700 (PDT)"  >Created an attachment (id=12584)&lt;br/&gt;
FTPClient.java.patch.txt</comment>
                    <comment id="12407411" author="jhindsley@providerlink.com" created="Tue, 31 Aug 2004 19:29:17 -0700 (PDT)"  >Sorry about the double FTPTest.java.patch.txt submission.</comment>
                    <comment id="12407412" author="rwinston@eircom.net" created="Fri, 15 Apr 2005 16:14:57 -0700 (PDT)"  >Sorry Joseph, what I actually meant to do was mark this as LATER. I think you&lt;br/&gt;
have some good ideas in here, and will be taking a better look when I get some time.</comment>
                    <comment id="12528982" author="bayard" created="Wed, 19 Sep 2007 22:25:23 -0700 (PDT)"  >Reopening - this was a Bugzilla LATER.</comment>
                </comments>
    
    <attachments>
            <attachment id="12333089" name="FTP.java.patch.txt" size="7340" author="jhindsley@providerlink.com" created="Tue, 31 Aug 2004 19:26:23 -0700 (PDT)" />
            <attachment id="12333092" name="FTPClient.java.patch.txt" size="2343" author="jhindsley@providerlink.com" created="Tue, 31 Aug 2004 19:28:34 -0700 (PDT)" />
            <attachment id="12333091" name="FTPTest.java.patch.txt" size="90822" author="jhindsley@providerlink.com" created="Tue, 31 Aug 2004 19:27:11 -0700 (PDT)" />
            <attachment id="12333090" name="FTPTest.java.patch.txt" size="90822" author="jhindsley@providerlink.com" created="Tue, 31 Aug 2004 19:26:46 -0700 (PDT)" />
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>30970</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-72] UnixFTPEntryParser returns null when timestamp is between 12:00am and 12:59am</title>
<link>http://issues.apache.org/jira/browse/NET-72</link>

                    <description>This concerns commons.net version 1.2.2.

&lt;p&gt;When I request a ftp listing from a directory with a file having a timestamp &lt;br/&gt;
between 12:00am and 12:59am on a Microsoft FTP Service (Version 5.0) box, the &lt;br/&gt;
FTPClient listFiles() method returns null for that file.  Here is an example &lt;br/&gt;
directory listing:&lt;/p&gt;

&lt;p&gt;-rwxrwxrwx   1 owner    group       115407014 Aug 12 19:33 images_20040812.zip&lt;br/&gt;
-rwxrwxrwx   1 owner    group       144408943 Aug 13  2:03 images_20040813.zip&lt;br/&gt;
-rwxrwxrwx   1 owner    group       146215270 Aug 14 10:29 images_20040814.zip&lt;br/&gt;
-rwxrwxrwx   1 owner    group       144822990 Aug 17  6:00 images_20040817.zip&lt;br/&gt;
-rwxrwxrwx   1 owner    group              22 Aug 18  0:36 test.zip&lt;/p&gt;

&lt;p&gt;The entry from listFiles() that corresponding text.zip will be null.&lt;/p&gt;

&lt;p&gt;I tracked down the problem to the REGEX pattern in UnixFTPEntryParser.  If I &lt;br/&gt;
change the expression to the following, I can get the FTPFile from the &lt;br/&gt;
listFiles() method.&lt;/p&gt;

&lt;p&gt;private static final String REGEX =&lt;br/&gt;
&quot;(&lt;span class=&quot;error&quot;&gt;&amp;#91;bcdlfmpSs-&amp;#93;&lt;/span&gt;)&quot;&lt;br/&gt;
+ &quot;(((r|&lt;del&gt;)(w|&lt;/del&gt;)(&lt;span class=&quot;error&quot;&gt;&amp;#91;xsStTL-&amp;#93;&lt;/span&gt;))((r|&lt;del&gt;)(w|&lt;/del&gt;)(&lt;span class=&quot;error&quot;&gt;&amp;#91;xsStTL-&amp;#93;&lt;/span&gt;))((r|&lt;del&gt;)(w|&lt;/del&gt;)(&lt;span class=&quot;error&quot;&gt;&amp;#91;xsStTL-&amp;#93;&lt;/span&gt;)))&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+ &quot;(\\d+)&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+ &quot;(\\S+)&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+ &quot;(?&lt;img class=&quot;emoticon&quot; src=&quot;https://issues.apache.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;\\S+)&lt;br clear=&quot;all&quot; /&gt;s+)?&quot;&lt;br/&gt;
+ &quot;(\\d+)&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+ MONTHS + &quot;&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+ &quot;((?:&lt;span class=&quot;error&quot;&gt;&amp;#91;0-9&amp;#93;&lt;/span&gt;)|(?:&lt;span class=&quot;error&quot;&gt;&amp;#91;0-2&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0-9&amp;#93;&lt;/span&gt;)|(?:3&lt;span class=&quot;error&quot;&gt;&amp;#91;0-1&amp;#93;&lt;/span&gt;))&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
// Following line changed&lt;br/&gt;
+ &quot;((\\d\\d\\d\\d)|((?:&lt;span class=&quot;error&quot;&gt;&amp;#91;01&amp;#93;&lt;/span&gt;\\d)|(?:2&lt;span class=&quot;error&quot;&gt;&amp;#91;0123&amp;#93;&lt;/span&gt;)|(?:&lt;span class=&quot;error&quot;&gt;&amp;#91;0-9&amp;#93;&lt;/span&gt;)):(&lt;span class=&quot;error&quot;&gt;&amp;#91;012345&amp;#93;&lt;/span&gt;\\d))&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
// Original line&lt;br/&gt;
//+ &quot;((\\d\\d\\d\\d)|((?:&lt;span class=&quot;error&quot;&gt;&amp;#91;01&amp;#93;&lt;/span&gt;\\d)|(?:2&lt;span class=&quot;error&quot;&gt;&amp;#91;0123&amp;#93;&lt;/span&gt;)|(?:&lt;span class=&quot;error&quot;&gt;&amp;#91;1-9&amp;#93;&lt;/span&gt;)):(&lt;span class=&quot;error&quot;&gt;&amp;#91;012345&amp;#93;&lt;/span&gt;\\d))&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+ &quot;(\\S+)(&lt;br clear=&quot;all&quot; /&gt;s*.*)&quot;;&lt;/p&gt;</description>
                <environment>Operating System: All&lt;br/&gt;
Platform: All</environment>
            <key id="12341648">NET-72</key>
        <summary>UnixFTPEntryParser returns null when timestamp is between 12:00am and 12:59am</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="k_flynn@yahoo.com">Kevin Flynn</reporter>
            
    <created>Wed, 18 Aug 2004 20:56:31 -0700 (PDT)</created>
    <updated>Wed, 19 Sep 2007 22:31:12 -0700 (PDT)</updated>

                
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12407294" author="weberjn" created="Mon, 13 Sep 2004 19:43:41 -0700 (PDT)"  >I ran into this bug too with an ftp server on W2K German with

&lt;p&gt;-rwxrwxrwx   1 owner    group          257112 Jun 27  0:45 testalbum.zip&lt;br/&gt;
drwxrwxrwx   1 owner    group               0 Aug 21  2002 testdir&lt;br/&gt;
drwxrwxrwx   1 owner    group               0 May 28  0:39 tmp&lt;/p&gt;

&lt;p&gt;testalbum.zip and tmp will result in null.&lt;/p&gt;

&lt;p&gt;I see two problems here: &lt;/p&gt;

&lt;p&gt;o the regex matcher will fail if there is only one field wrong. Maybe there&lt;br/&gt;
should be a regex call for each field, so could at least fill the correctly&lt;br/&gt;
parsed fields.&lt;br/&gt;
o in case of a failed match there should not be returned null but rather an&lt;br/&gt;
empty FTPFile. There was a real ftp server output line, so no need to have it&lt;br/&gt;
nulled. If there is a parse error, it&apos;s not the fault of the server but a bug in&lt;br/&gt;
the regex.&lt;/p&gt;</comment>
                    <comment id="12407295" author="scohen@apache.org" created="Tue, 14 Sep 2004 01:55:30 -0700 (PDT)"  >Adopted your regex fix, in a slightly different form. 

&lt;p&gt;On the other hand, I disagree that failure to parse should not return null.  This helps us to find &lt;br/&gt;
bugs in the regex! The goal is a bug-free regex that works with all variations of the format.  &lt;br/&gt;
Since the format is not tightly defined anywhere, implementers are somewhat free (I would say &lt;br/&gt;
too free) to come up with slightly different variations.  In most other servers 0:39 was rendered &lt;br/&gt;
as 00:39 which is why we never saw this problem before. &lt;/p&gt;</comment>
                    <comment id="12407296" author="weberjn" created="Tue, 14 Sep 2004 21:08:39 -0700 (PDT)"  >Returning null for a non-parsed entry is neither graceful degradation nor a&lt;br/&gt;
clear indication of the problem. The API of FTPClient.listFiles() does not&lt;br/&gt;
mention that it can return null entries, so it is not obvious why there are&lt;br/&gt;
holes in the returned array and why you run into NPEs.

&lt;p&gt;I think you should either return a FTPFile where at least getRawListing() works&lt;br/&gt;
(with maybe an additional method getParseStatus() ) or you should state loud and&lt;br/&gt;
clear that there was a problem by throwing a ParserException.&lt;/p&gt;</comment>
                    <comment id="12407297" author="scohen@apache.org" created="Wed, 15 Sep 2004 02:37:47 -0700 (PDT)"  >You raise an interesting point.  I still don&apos;t agree with it.  While I see merit in your claim that &lt;br/&gt;
having arrays with null members is not a good thing, there are similar problems also inherent in &lt;br/&gt;
&quot;incomplete&quot; objects.  The uninformed user may just as well stumble on NPEs when &lt;br/&gt;
dereferencing a non-existent date in a partially complete FTPFile, for example.  The null &lt;br/&gt;
member, while obviously not a perfect solution, does announce itself reasonably loudly, is &lt;br/&gt;
easily detectable by the user, and that has value.  Throwing an exception over the whole list &lt;br/&gt;
might be too draconian a penalty for one unparsed listing out of a hundred.  Thus, the current &lt;br/&gt;
implementation is a reasonable compromise, I think. 

&lt;p&gt;Our goal remains to have parsers that handle every conceivable case, even if that is almost &lt;br/&gt;
impossible to achieve given the wide array of implementations out there.  We are getting there, &lt;br/&gt;
asymptotically. &lt;/p&gt;

&lt;p&gt;Your point about the return value of listFiles() not being documented to warn the user of this &lt;br/&gt;
possibility is a valid one and I have now corrected it, both in FTPClient.listFiles() and in the &lt;br/&gt;
mehtods of FTPListParseEngine on which it depends. &lt;/p&gt;</comment>
                    <comment id="12407298" author="scohen@apache.org" created="Thu, 16 Sep 2004 13:39:38 -0700 (PDT)"  >An additional point here is backward compatibility.  This API is by now several years old.   

&lt;p&gt;Much code has been written based on the twin assumptions that: &lt;br/&gt;
1.  The returned array may contain null members and these must be checked for before &lt;br/&gt;
referencng and &lt;br/&gt;
2.  Any non-null member is a complete FTPFile object. &lt;/p&gt;

&lt;p&gt;Changing these assumptions to &lt;br/&gt;
1. Every member of the returned array will be non-null but &lt;br/&gt;
2. Any member of the array may be incomplete, with member fields that may be null &lt;/p&gt;

&lt;p&gt;will break too much existing code to be seriously considered as an alternative now.  If this was &lt;br/&gt;
the design phase of a new API, your points would obviously need to be taken into &lt;br/&gt;
consideration.  Undoubtedly, better designs are possible. &lt;/p&gt;
</comment>
                    <comment id="12407299" author="no.spam.lkral@web.de" created="Sun, 5 Dec 2004 13:54:44 -0800 (PST)"  >&lt;ul&gt;
	&lt;li&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;ul&gt;
			&lt;li&gt;*** Bug 31541 has been marked as a duplicate of this bug. *** has been marked as a duplicate of this bug. ***&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    <comment id="12407300" author="scohen@apache.org" created="Sat, 12 Feb 2005 13:57:22 -0800 (PST)"  >&lt;ul&gt;
	&lt;li&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;ul&gt;
			&lt;li&gt;COM-1002 has been marked as a duplicate of this bug. ***&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
</comment>
                </comments>
    
    <attachments>
        </attachments>

    <subtasks>
        </subtasks>

            <customfields>
                                    <customfield id="customfield_10010" key="com.atlassian.jira.plugin.system.customfieldtypes:importid">
                    <customfieldname>Bugzilla Id</customfieldname>
                    <customfieldvalues>
                        <customfieldvalue>30737</customfieldvalue>
                    </customfieldvalues>
                </customfield>
                        </customfields>
    
</item>

<item>
<title>[NET-2] [net] The FTPClient is unable to list files on Japanese servers</title>
<link>http://issues.apache.org/jira/browse/NET-2</link>

                    <description>I ran into some problems attempting to get the FTPClient to be able to list&lt;br/&gt;
files on a Solaris server which is configured to use the Japanese locale.  The&lt;br/&gt;
problem turned out to be caused by the regular expressions used to parse the&lt;br/&gt;
individual lines received from the server.

&lt;p&gt;It works great with the English locale, but on Japanese servers, every single&lt;br/&gt;
line of output was failing to match.&lt;/p&gt;

&lt;p&gt;I modified the UnixFTPEntryParser to work correctly with either English or&lt;br/&gt;
Japanese locales. I also added appropriate test cases to make sure every thing&lt;br/&gt;
works.&lt;/p&gt;

&lt;p&gt;Obviously other languages are going to most likely have similar problems.  The&lt;br/&gt;
way I modified the regex, should work correctly with any language that uses&lt;br/&gt;
numerical months and adds units after the month, day, and/or years.&lt;/p&gt;

&lt;p&gt;I also found that there were some encoding problems.  The FTP class allows the&lt;br/&gt;
user to configure a control encoding using the setControlEncoding() method.  But&lt;br/&gt;
this encoding was not being used is several places throughout the code.&lt;/p&gt;

&lt;p&gt;I had to add a couple new methods to handle encoding, but all existing public&lt;br/&gt;
methods were left unchanged and function the same as they did before.&lt;/p&gt;

&lt;p&gt;In addition, if the user specified an invalid control encoding when used with&lt;br/&gt;
the Ant task, it was kicking out some some nasty NPEs because the ant task always&lt;br/&gt;
tries to log off. That could be viewed as a problem with the Ant task, but I made&lt;br/&gt;
the FTP class handle this case more gracefully.  The problem is that the&lt;br/&gt;
isConnected method returns true when the socket has been opened, but the&lt;br/&gt;
protocol is not yet all the way initialized. The logout and disconnect methods&lt;br/&gt;
now handle these cases correctly.&lt;/p&gt;

&lt;p&gt;I will post right back with the patch.   This message was also posted on the dev&lt;br/&gt;
list.&lt;/p&gt;

&lt;p&gt;Cheers,&lt;br/&gt;
Leif&lt;/p&gt;</description>
                <environment>Operating System: All&lt;br/&gt;
Platform: All</environment>
            <key id="12341646">NET-2</key>
        <summary>[net] The FTPClient is unable to list files on Japanese servers</summary>
        <type id="1" iconUrl="http://issues.apache.org/jira/images/icons/bug.gif">Bug</type>
    
            <priority id="3" iconUrl="http://issues.apache.org/jira/images/icons/priority_major.gif">Major</priority>    
        <status id="6" iconUrl="http://issues.apache.org/jira/images/icons/status_closed.gif">Closed</status>
                        <resolution id="1">Fixed</resolution>
            
    
                        <assignee username="-1">Unassigned</assignee>
            
                        <reporter username="leif@tanukisoftware.com">Leif Mortenson</reporter>
            
    <created>Wed, 18 Aug 2004 06:26:45 -0700 (PDT)</created>
    <updated>Wed, 19 Sep 2007 22:31:02 -0700 (PDT)</updated>

                        <version>Nightly Builds</version>
            
                
                
            <due></due>
    
            <votes>0</votes>
    
                                        

            <comments>
                    <comment id="12407284" author="leif@tanukisoftware.com" created="Wed, 18 Aug 2004 06:27:44 -0700 (PDT)"  >Here is the full patch:

&lt;p&gt;cvs diff -u &lt;br/&gt;
cvs server: Diffing .&lt;br/&gt;
cvs server: Diffing proposal&lt;br/&gt;
cvs server: Diffing proposal/ftp2&lt;br/&gt;
cvs server: Diffing proposal/ftp2/src&lt;br/&gt;
cvs server: Diffing proposal/ftp2/src/java&lt;br/&gt;
cvs server: Diffing proposal/ftp2/src/java/org&lt;br/&gt;
cvs server: Diffing proposal/ftp2/src/java/org/apache&lt;br/&gt;
cvs server: Diffing proposal/ftp2/src/java/org/apache/commons&lt;br/&gt;
cvs server: Diffing proposal/ftp2/src/java/org/apache/commons/net&lt;br/&gt;
cvs server: Diffing proposal/ftp2/src/java/org/apache/commons/net/ftp&lt;br/&gt;
cvs server: Diffing proposal/ftp2/src/java/org/apache/commons/net/ftp/ftp2&lt;br/&gt;
cvs server: Diffing proposal/ftp2/src/java/org/apache/commons/net/ftp/ftp2/parser&lt;br/&gt;
cvs server: Diffing proposal/ftp2/src/test&lt;br/&gt;
cvs server: Diffing proposal/ftp2/src/test/org&lt;br/&gt;
cvs server: Diffing proposal/ftp2/src/test/org/apache&lt;br/&gt;
cvs server: Diffing proposal/ftp2/src/test/org/apache/commons&lt;br/&gt;
cvs server: Diffing proposal/ftp2/src/test/org/apache/commons/net&lt;br/&gt;
cvs server: Diffing proposal/ftp2/src/test/org/apache/commons/net/ftp&lt;br/&gt;
cvs server: Diffing proposal/ftp2/src/test/org/apache/commons/net/ftp/ftp2&lt;br/&gt;
cvs server: Diffing proposal/ftp2/src/test/org/apache/commons/net/ftp/ftp2/parser&lt;br/&gt;
cvs server: Diffing src&lt;br/&gt;
cvs server: Diffing src/java&lt;br/&gt;
cvs server: Diffing src/java/examples&lt;br/&gt;
cvs server: Diffing src/java/org&lt;br/&gt;
cvs server: Diffing src/java/org/apache&lt;br/&gt;
cvs server: Diffing src/java/org/apache/commons&lt;br/&gt;
cvs server: Diffing src/java/org/apache/commons/net&lt;br/&gt;
cvs server: Diffing src/java/org/apache/commons/net/bsd&lt;br/&gt;
cvs server: Diffing src/java/org/apache/commons/net/ftp&lt;br/&gt;
Index: src/java/org/apache/commons/net/ftp/FTP.java&lt;br/&gt;
===================================================================&lt;br/&gt;
RCS file:&lt;br/&gt;
/home/cvspublic/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTP.java,v&lt;br/&gt;
retrieving revision 1.16&lt;br/&gt;
diff -u -r1.16 FTP.java&lt;br/&gt;
&amp;#8212; src/java/org/apache/commons/net/ftp/FTP.java	8 Aug 2004 20:38:35 -0000	1.16&lt;br/&gt;
+++ src/java/org/apache/commons/net/ftp/FTP.java	18 Aug 2004 06:11:31 -0000&lt;br/&gt;
@@ -420,6 +420,11 @@&lt;br/&gt;
      ***/&lt;br/&gt;
     public int sendCommand(String command, String args) throws IOException&lt;br/&gt;
     {&lt;br/&gt;
+        if ((__commandBuffer == null) || (_controlOutput == null))&lt;br/&gt;
+        {
+            throw new IOException(&quot;Not connected.&quot;);
+        }&lt;br/&gt;
+        &lt;br/&gt;
         String message;&lt;/p&gt;

&lt;p&gt;         __commandBuffer.setLength(0);&lt;br/&gt;
Index: src/java/org/apache/commons/net/ftp/FTPClient.java&lt;br/&gt;
===================================================================&lt;br/&gt;
RCS file:&lt;br/&gt;
/home/cvspublic/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPClient.java,v&lt;br/&gt;
retrieving revision 1.38&lt;br/&gt;
diff -u -r1.38 FTPClient.java&lt;br/&gt;
&amp;#8212; src/java/org/apache/commons/net/ftp/FTPClient.java	29 Jun 2004 04:54:30&lt;br/&gt;
-0000	1.38&lt;br/&gt;
+++ src/java/org/apache/commons/net/ftp/FTPClient.java	18 Aug 2004 06:11:32 -0000&lt;br/&gt;
@@ -1931,8 +1931,8 @@&lt;br/&gt;
         if ((socket = &lt;em&gt;openDataConnection&lt;/em&gt;(FTPCommand.NLST, pathname)) == null)&lt;br/&gt;
             return null;&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;reader =&lt;/li&gt;
	&lt;li&gt;new BufferedReader(new InputStreamReader(socket.getInputStream()));&lt;br/&gt;
+        reader = new BufferedReader(&lt;br/&gt;
+            new InputStreamReader(socket.getInputStream(), getControlEncoding()));&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;         results = new Vector();&lt;br/&gt;
         while ((line = reader.readLine()) != null)&lt;br/&gt;
@@ -2338,7 +2338,7 @@&lt;br/&gt;
         }&lt;/p&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;engine.readServerList(socket.getInputStream());&lt;br/&gt;
+        engine.readServerList(socket.getInputStream(), getControlEncoding());&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;         socket.close();&lt;/p&gt;

&lt;p&gt;@@ -2425,7 +2425,7 @@&lt;br/&gt;
         if ((socket = &lt;em&gt;openDataConnection&lt;/em&gt;(FTPCommand.LIST, pathname)) == null)&lt;br/&gt;
             return new FTPFile&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;;&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;results = parser.parseFileList(socket.getInputStream());&lt;br/&gt;
+        results = parser.parseFileList(socket.getInputStream(),&lt;br/&gt;
getControlEncoding());&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;         socket.close();&lt;/p&gt;

&lt;p&gt;Index: src/java/org/apache/commons/net/ftp/FTPFileEntryParserImpl.java&lt;br/&gt;
===================================================================&lt;br/&gt;
RCS file:&lt;br/&gt;
/home/cvspublic/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileEntryParserImpl.java,v&lt;br/&gt;
retrieving revision 1.8&lt;br/&gt;
diff -u -r1.8 FTPFileEntryParserImpl.java&lt;br/&gt;
&amp;#8212; src/java/org/apache/commons/net/ftp/FTPFileEntryParserImpl.java	22 Apr 2004&lt;br/&gt;
00:48:07 -0000	1.8&lt;br/&gt;
+++ src/java/org/apache/commons/net/ftp/FTPFileEntryParserImpl.java	18 Aug 2004&lt;br/&gt;
06:11:32 -0000&lt;br/&gt;
@@ -34,7 +34,7 @@&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;The constructor for a FTPFileEntryParserImpl object.&lt;br/&gt;
      */&lt;br/&gt;
     public FTPFileEntryParserImpl()&lt;/li&gt;
&lt;/ul&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;{&lt;br/&gt;
+    {&lt;br/&gt;
     }&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;@@ -47,16 +47,37 @@&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&amp;lt;p&amp;gt;&lt;/li&gt;
	&lt;li&gt;@param listStream The InputStream from which the file list should be&lt;/li&gt;
	&lt;li&gt;read.&lt;br/&gt;
+     * @param encoding The encoding to use, null for system default.&lt;/li&gt;
	&lt;li&gt;@return The list of file information contained in the given path.  null&lt;/li&gt;
	&lt;li&gt;if the list could not be obtained or if there are no files in&lt;/li&gt;
	&lt;li&gt;the directory.&lt;/li&gt;
	&lt;li&gt;@exception java.io.IOException  If an I/O error occurs reading the&lt;br/&gt;
listStream.&lt;br/&gt;
      ***/&lt;/li&gt;
&lt;/ul&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;public FTPFile[] parseFileList(InputStream listStream) throws IOException&lt;br/&gt;
+    public FTPFile[] parseFileList(InputStream listStream, String encoding)&lt;br/&gt;
throws IOException
     {
-        FTPFileList ffl = FTPFileList.create(listStream, this);
+        FTPFileList ffl = FTPFileList.create(listStream, this, encoding);
         return ffl.getFiles();
+    }&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;+    /***&lt;br/&gt;
+     * Parses an FTP server file listing and converts it into a usable format&lt;br/&gt;
+     * in the form of an array of &amp;lt;code&amp;gt; FTPFile &amp;lt;/code&amp;gt; instances.  If the&lt;br/&gt;
+     * file list contains no files, &amp;lt;code&amp;gt; null &amp;lt;/code&amp;gt; should be&lt;br/&gt;
+     * returned, otherwise an array of &amp;lt;code&amp;gt; FTPFile &amp;lt;/code&amp;gt; instances&lt;br/&gt;
+     * representing the files in the directory is returned.&lt;br/&gt;
+     * &amp;lt;p&amp;gt;&lt;br/&gt;
+     * @param listStream The InputStream from which the file list should be&lt;br/&gt;
+     *        read.&lt;br/&gt;
+     * @return The list of file information contained in the given path.  null&lt;br/&gt;
+     *     if the list could not be obtained or if there are no files in&lt;br/&gt;
+     *     the directory.&lt;br/&gt;
+     * @exception java.io.IOException  If an I/O error occurs reading the&lt;br/&gt;
listStream.&lt;br/&gt;
+     *&lt;br/&gt;
+     * @deprecated The version of this method which takes an encoding should be&lt;br/&gt;
used.&lt;br/&gt;
+     ***/&lt;br/&gt;
+    public FTPFile[] parseFileList(InputStream listStream) throws IOException&lt;br/&gt;
+    {
+        return parseFileList(listStream, null);
     }&lt;/p&gt;

&lt;p&gt;     /**&lt;br/&gt;
Index: src/java/org/apache/commons/net/ftp/FTPFileList.java&lt;br/&gt;
===================================================================&lt;br/&gt;
RCS file:&lt;br/&gt;
/home/cvspublic/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileList.java,v&lt;br/&gt;
retrieving revision 1.13&lt;br/&gt;
diff -u -r1.13 FTPFileList.java&lt;br/&gt;
&amp;#8212; src/java/org/apache/commons/net/ftp/FTPFileList.java	21 Apr 2004 23:30:33&lt;br/&gt;
-0000	1.13&lt;br/&gt;
+++ src/java/org/apache/commons/net/ftp/FTPFileList.java	18 Aug 2004 06:11:32 -0000&lt;br/&gt;
@@ -82,6 +82,7 @@&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;the output of the LIST command was returned&lt;/li&gt;
	&lt;li&gt;@param parser the default &amp;lt;code&amp;gt;FTPFileEntryParser&amp;lt;/code&amp;gt; to be used&lt;/li&gt;
	&lt;li&gt;by this object.  This may later be changed using the init() method.&lt;br/&gt;
+     * @param encoding The encoding to use, null for system default.&lt;br/&gt;
      *&lt;/li&gt;
	&lt;li&gt;@return the &amp;lt;code&amp;gt;FTPFileList&amp;lt;/code&amp;gt; created, with an initialized&lt;/li&gt;
	&lt;li&gt;of unparsed lines of output.  Will be null if the listing cannot&lt;br/&gt;
@@ -90,26 +91,61 @@&lt;/li&gt;
	&lt;li&gt;Thrown on any failure to read from the socket.&lt;br/&gt;
      */&lt;br/&gt;
     public static FTPFileList create(InputStream stream,&lt;/li&gt;
&lt;/ul&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;FTPFileEntryParser parser)&lt;br/&gt;
+                                     FTPFileEntryParser parser,&lt;br/&gt;
+                                     String encoding)&lt;br/&gt;
             throws IOException
     {
         FTPFileList list = new FTPFileList(parser);
-        list.readStream(stream);
+        list.readStream(stream, encoding);
         parser.preParse(list.lines);
         return list;
     }&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;     /**&lt;br/&gt;
+     * The only way to create an &amp;lt;code&amp;gt;FTPFileList&amp;lt;/code&amp;gt; object.  Invokes&lt;br/&gt;
+     * the private constructor and then reads the stream  supplied stream to&lt;br/&gt;
+     * build the intermediate array of &quot;lines&quot; which will later be parsed&lt;br/&gt;
+     * into &amp;lt;code&amp;gt;FTPFile&amp;lt;/code&amp;gt; object.&lt;br/&gt;
+     *&lt;br/&gt;
+     * @param stream The input stream created by reading the socket on which&lt;br/&gt;
+     * the output of the LIST command was returned&lt;br/&gt;
+     * @param parser the default &amp;lt;code&amp;gt;FTPFileEntryParser&amp;lt;/code&amp;gt; to be used&lt;br/&gt;
+     * by this object.  This may later be changed using the init() method.&lt;br/&gt;
+     *&lt;br/&gt;
+     * @return the &amp;lt;code&amp;gt;FTPFileList&amp;lt;/code&amp;gt; created, with an initialized&lt;br/&gt;
+     * of unparsed lines of output.  Will be null if the listing cannot&lt;br/&gt;
+     * be read from the stream.&lt;br/&gt;
+     * @exception IOException&lt;br/&gt;
+     *                   Thrown on any failure to read from the socket.&lt;br/&gt;
+     *&lt;br/&gt;
+     * @deprecated The version of this method which takes an encoding should be&lt;br/&gt;
used.&lt;br/&gt;
+     */&lt;br/&gt;
+    public static FTPFileList create(InputStream stream,&lt;br/&gt;
+                                     FTPFileEntryParser parser)&lt;br/&gt;
+            throws IOException&lt;br/&gt;
+    {
+        return create(stream, parser, null);
+    }&lt;br/&gt;
+&lt;br/&gt;
+    /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;internal method for reading the input into the &amp;lt;code&amp;gt;lines&amp;lt;/code&amp;gt; vector.&lt;br/&gt;
      *&lt;/li&gt;
	&lt;li&gt;@param stream The socket stream on which the input will be read.&lt;br/&gt;
+     * @param encoding The encoding to use, null for system default.&lt;br/&gt;
      *&lt;/li&gt;
	&lt;li&gt;@exception IOException thrown on any failure to read the stream&lt;br/&gt;
      */&lt;/li&gt;
&lt;/ul&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;public void readStream(InputStream stream) throws IOException&lt;br/&gt;
+    public void readStream(InputStream stream, String encoding) throws IOException&lt;br/&gt;
     {&lt;/li&gt;
	&lt;li&gt;BufferedReader reader =&lt;/li&gt;
	&lt;li&gt;new BufferedReader(new InputStreamReader(stream));&lt;br/&gt;
+        BufferedReader reader;&lt;br/&gt;
+        if (encoding == null)&lt;br/&gt;
+        {
+            reader = new BufferedReader(new InputStreamReader(stream));
+        }&lt;br/&gt;
+        else&lt;br/&gt;
+        {
+            reader = new BufferedReader(new InputStreamReader(stream, encoding));
+        }&lt;br/&gt;
 &lt;br/&gt;
         String line = this.parser.readNextEntry(reader);&lt;br/&gt;
 &lt;br/&gt;
@@ -119,6 +155,20 @@&lt;br/&gt;
             line = this.parser.readNextEntry(reader);&lt;br/&gt;
         }&lt;br/&gt;
         reader.close();&lt;br/&gt;
+    }&lt;br/&gt;
+&lt;br/&gt;
+    /**&lt;br/&gt;
+     * internal method for reading the input into the &amp;lt;code&amp;gt;lines&amp;lt;/code&amp;gt; vector.&lt;br/&gt;
+     *&lt;br/&gt;
+     * @param stream The socket stream on which the input will be read.&lt;br/&gt;
+     *&lt;br/&gt;
+     * @exception IOException thrown on any failure to read the stream&lt;br/&gt;
+     *&lt;br/&gt;
+     * @deprecated The version of this method which takes an encoding should be&lt;br/&gt;
used.&lt;br/&gt;
+     */&lt;br/&gt;
+    public void readStream(InputStream stream) throws IOException&lt;br/&gt;
+    {
+        readStream(stream, null);
     }&lt;br/&gt;
 &lt;br/&gt;
     /**&lt;br/&gt;
Index: src/java/org/apache/commons/net/ftp/FTPFileListParser.java&lt;br/&gt;
===================================================================&lt;br/&gt;
RCS file:&lt;br/&gt;
/home/cvspublic/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileListParser.java,v&lt;br/&gt;
retrieving revision 1.12&lt;br/&gt;
diff -u -r1.12 FTPFileListParser.java&lt;br/&gt;
&amp;#8212; src/java/org/apache/commons/net/ftp/FTPFileListParser.java	29 Jun 2004&lt;br/&gt;
02:16:33 -0000	1.12&lt;br/&gt;
+++ src/java/org/apache/commons/net/ftp/FTPFileListParser.java	18 Aug 2004&lt;br/&gt;
06:11:32 -0000&lt;br/&gt;
@@ -45,10 +45,29 @@&lt;br/&gt;
      * &amp;lt;p&amp;gt;&lt;br/&gt;
      * @param listStream The InputStream from which the file list should be&lt;br/&gt;
      *        read.&lt;br/&gt;
+     * @param encoding The encoding to use, null for system default.&lt;br/&gt;
      * @return The list of file information contained in the given path.  null&lt;br/&gt;
      *     if the list could not be obtained or if there are no files in&lt;br/&gt;
      *     the directory.&lt;br/&gt;
      * @exception IOException  If an I/O error occurs reading the listStream.&lt;br/&gt;
+     ***/&lt;br/&gt;
+    FTPFile[] parseFileList(InputStream listStream, String encoding) throws&lt;br/&gt;
IOException;&lt;br/&gt;
+&lt;br/&gt;
+    /***&lt;br/&gt;
+     * Parses an FTP server file listing and converts it into a usable format&lt;br/&gt;
+     * in the form of an array of &amp;lt;code&amp;gt; FTPFile &amp;lt;/code&amp;gt; instances.  If the&lt;br/&gt;
+     * file list contains no files, &amp;lt;code&amp;gt; null &amp;lt;/code&amp;gt; should be&lt;br/&gt;
+     * returned, otherwise an array of &amp;lt;code&amp;gt; FTPFile &amp;lt;/code&amp;gt; instances&lt;br/&gt;
+     * representing the files in the directory is returned.&lt;br/&gt;
+     * &amp;lt;p&amp;gt;&lt;br/&gt;
+     * @param listStream The InputStream from which the file list should be&lt;br/&gt;
+     *        read.&lt;br/&gt;
+     * @return The list of file information contained in the given path.  null&lt;br/&gt;
+     *     if the list could not be obtained or if there are no files in&lt;br/&gt;
+     *     the directory.&lt;br/&gt;
+     * @exception IOException  If an I/O error occurs reading the listStream.&lt;br/&gt;
+     *&lt;br/&gt;
+     * @deprecated The version of this method which takes an encoding should be&lt;br/&gt;
used.&lt;br/&gt;
      ***/&lt;br/&gt;
     FTPFile[] parseFileList(InputStream listStream) throws IOException;&lt;br/&gt;
 &lt;br/&gt;
Index: src/java/org/apache/commons/net/ftp/FTPListParseEngine.java&lt;br/&gt;
===================================================================&lt;br/&gt;
RCS file:&lt;br/&gt;
/home/cvspublic/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPListParseEngine.java,v&lt;br/&gt;
retrieving revision 1.7&lt;br/&gt;
diff -u -r1.7 FTPListParseEngine.java&lt;br/&gt;
&amp;#8212; src/java/org/apache/commons/net/ftp/FTPListParseEngine.java	22 Apr 2004&lt;br/&gt;
00:48:07 -0000	1.7&lt;br/&gt;
+++ src/java/org/apache/commons/net/ftp/FTPListParseEngine.java	18 Aug 2004&lt;br/&gt;
06:11:33 -0000&lt;br/&gt;
@@ -87,19 +87,39 @@&lt;br/&gt;
      * on the server.&lt;br/&gt;
      *&lt;br/&gt;
      * @param stream input stream provided by the server socket.&lt;br/&gt;
+     * @param encoding The encoding to use, null for system default.&lt;br/&gt;
      *&lt;br/&gt;
      * @exception IOException&lt;br/&gt;
      *                   thrown on any failure to read from the sever.&lt;br/&gt;
      */&lt;br/&gt;
-    public void readServerList(InputStream stream)&lt;br/&gt;
+    public void readServerList(InputStream stream, String encoding)&lt;br/&gt;
     throws IOException&lt;br/&gt;
     {
         this.entries = new LinkedList();
-        readStream(stream);
+        readStream(stream, encoding);
         this.parser.preParse(this.entries);
         resetIterator();
     }&lt;br/&gt;
 &lt;br/&gt;
+    /**&lt;br/&gt;
+     * handle the iniitial reading and preparsing of the list returned by&lt;br/&gt;
+     * the server.  After this method has completed, this object will contain&lt;br/&gt;
+     * a list of unparsed entries (Strings) each referring to a unique file&lt;br/&gt;
+     * on the server.&lt;br/&gt;
+     *&lt;br/&gt;
+     * @param stream input stream provided by the server socket.&lt;br/&gt;
+     *&lt;br/&gt;
+     * @exception IOException&lt;br/&gt;
+     *                   thrown on any failure to read from the sever.&lt;br/&gt;
+     *&lt;br/&gt;
+     * @deprecated The version of this method which takes an encoding should be&lt;br/&gt;
used.&lt;br/&gt;
+     */&lt;br/&gt;
+    public void readServerList(InputStream stream)&lt;br/&gt;
+    throws IOException&lt;br/&gt;
+    {
+        readServerList(stream, null);
+    }&lt;br/&gt;
+&lt;br/&gt;
 &lt;br/&gt;
     /**&lt;br/&gt;
      * Internal method for reading the input into the &amp;lt;code&amp;gt;entries&amp;lt;/code&amp;gt; list.&lt;br/&gt;
@@ -110,14 +130,22 @@&lt;br/&gt;
      * and other data that will not be part of the final listing.&lt;br/&gt;
      *&lt;br/&gt;
      * @param stream The socket stream on which the input will be read.&lt;br/&gt;
+     * @param encoding The encoding to use, null for system default.&lt;br/&gt;
      *&lt;br/&gt;
      * @exception IOException&lt;br/&gt;
      *                   thrown on any failure to read the stream&lt;br/&gt;
      */&lt;br/&gt;
-    private void readStream(InputStream stream) throws IOException&lt;br/&gt;
+    private void readStream(InputStream stream, String encoding) throws IOException&lt;br/&gt;
     {&lt;br/&gt;
-        BufferedReader reader =&lt;br/&gt;
-            new BufferedReader(new InputStreamReader(stream));&lt;br/&gt;
+        BufferedReader reader;&lt;br/&gt;
+        if (encoding == null)&lt;br/&gt;
+        {+            reader = new BufferedReader(new InputStreamReader(stream));+        } }&lt;br/&gt;
+        else&lt;br/&gt;
+        {
+            reader = new BufferedReader(new InputStreamReader(stream, encoding));
+        }&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;         String line = this.parser.readNextEntry(reader);&lt;/p&gt;

&lt;p&gt;cvs server: Diffing src/java/org/apache/commons/net/ftp/parser&lt;br/&gt;
Index: src/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java&lt;br/&gt;
===================================================================&lt;br/&gt;
RCS file:&lt;br/&gt;
/home/cvspublic/jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java,v&lt;br/&gt;
retrieving revision 1.18&lt;br/&gt;
diff -u -r1.18 UnixFTPEntryParser.java&lt;br/&gt;
&amp;#8212; src/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java	28 Jul&lt;br/&gt;
2004 05:01:47 -0000	1.18&lt;br/&gt;
+++ src/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java	18 Aug&lt;br/&gt;
2004 06:11:33 -0000&lt;br/&gt;
@@ -35,7 +35,7 @@&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;to determine which month is matched by the parser&lt;br/&gt;
      */&lt;br/&gt;
     private static final String MONTHS =&lt;/li&gt;
&lt;/ul&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&quot;(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)&quot;;&lt;br/&gt;
+        &quot;Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec&quot;;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;     /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;this is the regular expression used by this parser.&lt;br/&gt;
@@ -55,6 +55,15 @@&lt;/li&gt;
	&lt;li&gt;execution is on&lt;/li&gt;
	&lt;li&gt;T   the 1000 bit is turned on, and execution is off (undefined bit-&lt;/li&gt;
	&lt;li&gt;state)&lt;br/&gt;
+     *&lt;br/&gt;
+     * Japanese formatted listings use numerical months, and the month, day&lt;br/&gt;
+     *  and year are each followed by a single kanji character.  Rather than&lt;br/&gt;
+     *  testing for the specific kanji characters, this expression allows any&lt;br/&gt;
+     *  non-numerical, non-space character(s).  This should make other languages&lt;br/&gt;
+     *  which use a similar syntax work as well.&lt;br/&gt;
+     *&lt;br/&gt;
+     * (For Japanese, the matched characters are &apos;\u6708&apos; after month,&lt;br/&gt;
+     *  &apos;\u65e5&apos; after day, and &apos;\u5e74&apos; after year.)&lt;br/&gt;
      */&lt;br/&gt;
     private static final String REGEX =&lt;br/&gt;
         &quot;(&lt;span class=&quot;error&quot;&gt;&amp;#91;bcdlfmpSs-&amp;#93;&lt;/span&gt;)&quot;&lt;br/&gt;
@@ -63,9 +72,9 @@&lt;br/&gt;
         + &quot;(\\S+)&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
         + &quot;(?&lt;img class=&quot;emoticon&quot; src=&quot;https://issues.apache.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;\\S+)&lt;br clear=&quot;all&quot; /&gt;s+)?&quot;&lt;br/&gt;
         + &quot;(\\d+)&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;+ MONTHS + &quot;&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;/li&gt;
	&lt;li&gt;+ &quot;((?:&lt;span class=&quot;error&quot;&gt;&amp;#91;0-9&amp;#93;&lt;/span&gt;)|(?:&lt;span class=&quot;error&quot;&gt;&amp;#91;0-2&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0-9&amp;#93;&lt;/span&gt;)|(?:3&lt;span class=&quot;error&quot;&gt;&amp;#91;0-1&amp;#93;&lt;/span&gt;))&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;/li&gt;
	&lt;li&gt;+ &quot;((\\d\\d\\d\\d)|((?:&lt;span class=&quot;error&quot;&gt;&amp;#91;01&amp;#93;&lt;/span&gt;\\d)|(?:2&lt;span class=&quot;error&quot;&gt;&amp;#91;0123&amp;#93;&lt;/span&gt;)|(?:&lt;span class=&quot;error&quot;&gt;&amp;#91;1-9&amp;#93;&lt;/span&gt;)):(&lt;span class=&quot;error&quot;&gt;&amp;#91;012345&amp;#93;&lt;/span&gt;\\d))&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+        + &quot;((?:&quot; + MONTHS + &quot;)|(?&lt;img class=&quot;emoticon&quot; src=&quot;https://issues.apache.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;?&lt;img class=&quot;emoticon&quot; src=&quot;https://issues.apache.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;?:&lt;span class=&quot;error&quot;&gt;&amp;#91;0-9&amp;#93;&lt;/span&gt;)|(?:&lt;span class=&quot;error&quot;&gt;&amp;#91;0-1&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0-9&amp;#93;&lt;/span&gt;))))&lt;span class=&quot;error&quot;&gt;&amp;#91;^0-9\\s&amp;#93;&lt;/span&gt;*?&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+        + &quot;(?&lt;img class=&quot;emoticon&quot; src=&quot;https://issues.apache.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;(?:&lt;span class=&quot;error&quot;&gt;&amp;#91;0-9&amp;#93;&lt;/span&gt;)|(?:&lt;span class=&quot;error&quot;&gt;&amp;#91;0-2&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0-9&amp;#93;&lt;/span&gt;)|(?:3&lt;span class=&quot;error&quot;&gt;&amp;#91;0-1&amp;#93;&lt;/span&gt;))(?:&lt;span class=&quot;error&quot;&gt;&amp;#91;^0-9\\s&amp;#93;&lt;/span&gt;*?))&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
+        +&lt;br/&gt;
&quot;((?&lt;img class=&quot;emoticon&quot; src=&quot;https://issues.apache.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;\\d\\d\\d\\d)&lt;span class=&quot;error&quot;&gt;&amp;#91;^0-9\\s&amp;#93;&lt;/span&gt;*?)|((?:&lt;span class=&quot;error&quot;&gt;&amp;#91;01&amp;#93;&lt;/span&gt;\\d)|(?:2&lt;span class=&quot;error&quot;&gt;&amp;#91;0123&amp;#93;&lt;/span&gt;)|(?:&lt;span class=&quot;error&quot;&gt;&amp;#91;1-9&amp;#93;&lt;/span&gt;)):(&lt;span class=&quot;error&quot;&gt;&amp;#91;012345&amp;#93;&lt;/span&gt;\\d))&lt;br clear=&quot;all&quot; /&gt;s+&quot;&lt;br/&gt;
         + &quot;(\\S+)(&lt;br clear=&quot;all&quot; /&gt;s*.*)&quot;;&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;@@ -94,7 +103,6 @@&lt;br/&gt;
      */&lt;br/&gt;
     public FTPFile parseFTPEntry(String entry)&lt;br/&gt;
     {&lt;br/&gt;
-&lt;br/&gt;
         FTPFile file = new FTPFile();&lt;br/&gt;
         file.setRawListing(entry);&lt;br/&gt;
         int type;&lt;br/&gt;
@@ -114,7 +122,7 @@&lt;br/&gt;
             String min = group(24);&lt;br/&gt;
             String name = group(25);&lt;br/&gt;
             String endtoken = group(26);&lt;br/&gt;
-&lt;br/&gt;
+            &lt;br/&gt;
             // bcdlfmpSs-&lt;br/&gt;
             switch (typeStr.charAt(0))&lt;/p&gt;
             {
@@ -130,8 +138,8 @@
                 // break; - fall through
             case &apos;f&apos;:
             case &apos;-&apos;:
-            	type = FTPFile.FILE_TYPE;
-            	break;
+                type = FTPFile.FILE_TYPE;
+                break;
             default:
                 type = FTPFile.UNKNOWN_TYPE;
             }
&lt;p&gt;@@ -189,8 +197,17 @@&lt;/p&gt;

&lt;p&gt;             try&lt;br/&gt;
             {&lt;br/&gt;
+                int month;&lt;br/&gt;
                 int pos = MONTHS.indexOf(mo);&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;int month = pos / 4;&lt;br/&gt;
+                if ( pos &amp;gt;= 0 )&lt;br/&gt;
+                {
+                    month = pos / 4;
+                }&lt;br/&gt;
+                else&lt;br/&gt;
+                {
+                    // Expected to be base-0
+                    month = Integer.parseInt( mo ) - 1;
+                }&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;                 if (null != yr)&lt;br/&gt;
                 {&lt;br/&gt;
Index: src/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java&lt;br/&gt;
===================================================================&lt;br/&gt;
RCS file:&lt;br/&gt;
/home/cvspublic/jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java,v&lt;br/&gt;
retrieving revision 1.24&lt;br/&gt;
diff -u -r1.24 VMSFTPEntryParser.java&lt;br/&gt;
&amp;#8212; src/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java	28 Jul&lt;br/&gt;
2004 05:01:47 -0000	1.24&lt;br/&gt;
+++ src/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java	18 Aug&lt;br/&gt;
2004 06:11:33 -0000&lt;br/&gt;
@@ -94,18 +94,17 @@&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&amp;lt;p&amp;gt;&lt;/li&gt;
	&lt;li&gt;@param listStream The InputStream from which the file list should be&lt;/li&gt;
	&lt;li&gt;read.&lt;br/&gt;
+     * @param encoding The encoding to use, null for system default.&lt;/li&gt;
	&lt;li&gt;@return The list of file information contained in the given path.  null&lt;/li&gt;
	&lt;li&gt;if the list could not be obtained or if there are no files in&lt;/li&gt;
	&lt;li&gt;the directory.&lt;/li&gt;
	&lt;li&gt;@exception IOException  If an I/O error occurs reading the listStream.&lt;br/&gt;
      ***/&lt;/li&gt;
&lt;/ul&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;public FTPFile[] parseFileList(InputStream listStream) throws IOException {&lt;br/&gt;
+    public FTPFile[] parseFileList(InputStream listStream, String encoding)&lt;br/&gt;
throws IOException {
         FTPListParseEngine engine = new FTPListParseEngine(this);
-        engine.readServerList(listStream);
+        engine.readServerList(listStream, encoding);
         return engine.getFiles();
     }&lt;br/&gt;
-&lt;br/&gt;
-&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;     /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Parses a line of a VMS FTP server file listing and converts it into a&lt;br/&gt;
cvs server: Diffing src/java/org/apache/commons/net/io&lt;br/&gt;
cvs server: Diffing src/java/org/apache/commons/net/nntp&lt;br/&gt;
cvs server: Diffing src/java/org/apache/commons/net/pop3&lt;br/&gt;
cvs server: Diffing src/java/org/apache/commons/net/smtp&lt;br/&gt;
cvs server: Diffing src/java/org/apache/commons/net/telnet&lt;br/&gt;
cvs server: Diffing src/java/org/apache/commons/net/tftp&lt;br/&gt;
cvs server: Diffing src/java/org/apache/commons/net/util&lt;br/&gt;
cvs server: Diffing src/test&lt;br/&gt;
cvs server: Diffing src/test/org&lt;br/&gt;
cvs server: Diffing src/test/org/apache&lt;br/&gt;
cvs server: Diffing src/test/org/apache/commons&lt;br/&gt;
cvs server: Diffing src/test/org/apache/commons/net&lt;br/&gt;
cvs server: Diffing src/test/org/apache/commons/net/ftp&lt;br/&gt;
cvs server: Diffing src/test/org/apache/commons/net/ftp/parser&lt;br/&gt;
Index: src/test/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java&lt;br/&gt;
===================================================================&lt;br/&gt;
RCS file:&lt;br/&gt;
/home/cvspublic/jakarta-commons/net/src/test/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java,v&lt;br/&gt;
retrieving revision 1.14&lt;br/&gt;
diff -u -r1.14 UnixFTPEntryParserTest.java
	&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
		&lt;li&gt;
		&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
			&lt;li&gt;src/test/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java	29&lt;br/&gt;
Jul 2004 11:38:36 -0000	1.14&lt;br/&gt;
+++ src/test/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java	18&lt;br/&gt;
Aug 2004 06:11:33 -0000&lt;br/&gt;
@@ -14,7 +14,6 @@&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;limitations under the License.&lt;br/&gt;
  */&lt;br/&gt;
 package org.apache.commons.net.ftp.parser;&lt;br/&gt;
-&lt;br/&gt;
 import java.util.Calendar;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt; import junit.framework.TestSuite;&lt;br/&gt;
@@ -69,7 +68,9 @@&lt;br/&gt;
         &quot;-rwxr-xr-t   1 500      500             0 Mar 25 08:21 testStickyExec&quot;,&lt;br/&gt;
         &quot;&lt;del&gt;rwSr-Sr&lt;/del&gt;-   1 500      500             0 Mar 25 08:22 testSuid&quot;,&lt;br/&gt;
         &quot;&lt;del&gt;rwsr-sr&lt;/del&gt;-   1 500      500             0 Mar 25 08:23 testSuidExec&quot;,&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&quot;&lt;del&gt;rw-r&lt;/del&gt;&lt;del&gt;r&lt;/del&gt;-   1 1        3518644 May 25 12:12 std&quot;&lt;br/&gt;
+        &quot;&lt;del&gt;rw-r&lt;/del&gt;&lt;del&gt;r&lt;/del&gt;-   1 1        3518644 May 25 12:12 std&quot;,&lt;br/&gt;
+        &quot;&lt;del&gt;rw-rw&lt;/del&gt;---   1 ep1adm   sapsys         0  8\u6708 17\u65e5  20:10&lt;br/&gt;
caerrinf&quot;,&lt;br/&gt;
+        &quot;&lt;del&gt;rw-rw&lt;/del&gt;---   1 ep1adm   sapsys         0  6\u6708  3\u65e5 2003\u5e74&lt;br/&gt;
\u8a66\u9a13\u30d5\u30a1\u30a4\u30eb.csv&quot;&lt;br/&gt;
     };&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;     /**&lt;br/&gt;
@@ -215,6 +216,78 @@&lt;br/&gt;
         cal.set(Calendar.DATE,2);&lt;br/&gt;
         cal.set(Calendar.HOUR_OF_DAY, 15);&lt;br/&gt;
         cal.set(Calendar.MINUTE, 13);&lt;br/&gt;
+        assertEquals(df.format(cal.getTime()),&lt;br/&gt;
+                     df.format(f.getTimestamp().getTime()));&lt;br/&gt;
+    }&lt;br/&gt;
+&lt;br/&gt;
+    /**&lt;br/&gt;
+     * @see&lt;br/&gt;
org.apache.commons.net.ftp.parser.FTPParseTestFramework#testParseFieldsOnFile()&lt;br/&gt;
+     */&lt;br/&gt;
+    public void testParseFieldsOnFileJapaneseTime() throws Exception&lt;br/&gt;
+    {&lt;br/&gt;
+        FTPFile f = getParser().parseFTPEntry(&quot;-rwxr-xr-x   2 user     group  &lt;br/&gt;
      4096 3\u6708  2\u65e5 15:13 zxbox&quot;);&lt;br/&gt;
+        assertNotNull(&quot;Could not parse entry.&quot;,&lt;br/&gt;
+                      f);&lt;br/&gt;
+        assertTrue(&quot;Should have been a file.&quot;,&lt;br/&gt;
+                   f.isFile());&lt;br/&gt;
+        checkPermissions(f);&lt;br/&gt;
+        assertEquals(2,&lt;br/&gt;
+                     f.getHardLinkCount());&lt;br/&gt;
+        assertEquals(&quot;user&quot;,&lt;br/&gt;
+                     f.getUser());&lt;br/&gt;
+        assertEquals(&quot;group&quot;,&lt;br/&gt;
+                     f.getGroup());&lt;br/&gt;
+        assertEquals(&quot;zxbox&quot;,&lt;br/&gt;
+                     f.getName());&lt;br/&gt;
+        assertEquals(4096,&lt;br/&gt;
+                     f.getSize());&lt;br/&gt;
+&lt;br/&gt;
+        Calendar cal = Calendar.getInstance();&lt;br/&gt;
+        cal.set(Calendar.MONTH, Calendar.MARCH);&lt;br/&gt;
+&lt;br/&gt;
+        cal.set(Calendar.DATE,1);&lt;br/&gt;
+        cal.set(Calendar.HOUR_OF_DAY, 0);&lt;br/&gt;
+        cal.set(Calendar.MINUTE, 0);&lt;br/&gt;
+        cal.set(Calendar.SECOND, 0);&lt;br/&gt;
+        if (f.getTimestamp().getTime().before(cal.getTime())) {
+            cal.add(Calendar.YEAR, -1);
+        }&lt;br/&gt;
+        cal.set(Calendar.DATE,2);&lt;br/&gt;
+        cal.set(Calendar.HOUR_OF_DAY, 15);&lt;br/&gt;
+        cal.set(Calendar.MINUTE, 13);&lt;br/&gt;
+        assertEquals(df.format(cal.getTime()),&lt;br/&gt;
+                     df.format(f.getTimestamp().getTime()));&lt;br/&gt;
+    }&lt;br/&gt;
+&lt;br/&gt;
+    /**&lt;br/&gt;
+     * @see&lt;br/&gt;
org.apache.commons.net.ftp.parser.FTPParseTestFramework#testParseFieldsOnFile()&lt;br/&gt;
+     */&lt;br/&gt;
+    public void testParseFieldsOnFileJapaneseYear() throws Exception&lt;br/&gt;
+    {
+        FTPFile f = getParser().parseFTPEntry(&quot;-rwxr-xr-x   2 user     group  
      4096 3\u6708  2\u65e5 2003\u5e74 \u8a66\u9a13\u30d5\u30a1\u30a4\u30eb.csv&quot;);
+        assertNotNull(&quot;Could not parse entry.&quot;,
+                      f);
+        assertTrue(&quot;Should have been a file.&quot;,
+                   f.isFile());
+        checkPermissions(f);
+        assertEquals(2,
+                     f.getHardLinkCount());
+        assertEquals(&quot;user&quot;,
+                     f.getUser());
+        assertEquals(&quot;group&quot;,
+                     f.getGroup());
+        assertEquals(&quot;\u8a66\u9a13\u30d5\u30a1\u30a4\u30eb.csv&quot;,
+                     f.getName());
+        assertEquals(4096,
+                     f.getSize());
+
+        Calendar cal = Calendar.getInstance();
+        cal.set(C