commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 30719] New: - The FTPClient is unable to list files on Japanese servers.
Date Wed, 18 Aug 2004 06:26:46 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30719>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30719

The FTPClient is unable to list files on Japanese servers.

           Summary: The FTPClient is unable to list files on Japanese
                    servers.
           Product: Commons
           Version: 1.0 Alpha
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Net
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: leif@tanukisoftware.com


I ran into some problems attempting to get the FTPClient to be able to list
files on a Solaris server which is configured to use the Japanese locale.  The
problem turned out to be caused by the regular expressions used to parse the
individual lines received from the server.

It works great with the English locale, but on Japanese servers, every single
line of output was failing to match.

I modified the UnixFTPEntryParser to work correctly with either English or
Japanese locales. I also added appropriate test cases to make sure every thing
works.

Obviously other languages are going to most likely have similar problems.  The
way I modified the regex, should work correctly with any language that uses
numerical months and adds units after the month, day, and/or years.

I also found that there were some encoding problems.  The FTP class allows the
user to configure a control encoding using the setControlEncoding() method.  But
this encoding was not being used is several places throughout the code.

I had to add a couple new methods to handle encoding, but all existing public
methods were left unchanged and function the same as they did before.

In addition, if the user specified an invalid control encoding when used with
the Ant task, it was kicking out some some nasty NPEs because the ant task always
tries to log off. That could be viewed as a problem with the Ant task, but I made
the FTP class handle this case more gracefully.  The problem is that the
isConnected method returns true when the socket has been opened, but the
protocol is not yet all the way initialized. The logout and disconnect methods
now handle these cases correctly.

I will post right back with the patch.   This message was also posted on the dev
list.

Cheers,
Leif

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message