Issue Details (XML | Word | Printable)

Key: NET-36
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Joseph Hindsley
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Net

[net] PATCH] FTP and FTPClient changes

Created: 01/Sep/04 02:25 AM   Updated: 08/Mar/08 07:38 PM
Return to search
Component/s: None
Affects Version/s: 1.2
Fix Version/s: 2.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File FTP.java.patch.txt 2004-09-01 02:26 AM Joseph Hindsley 7 kB
Text File FTPClient.java.patch.txt 2004-09-01 02:28 AM Joseph Hindsley 2 kB
Text File FTPTest.java.patch.txt 2004-09-01 02:27 AM Joseph Hindsley 89 kB
Text File FTPTest.java.patch.txt 2004-09-01 02:26 AM Joseph Hindsley 89 kB
Environment:
Operating System: other
Platform: Other

Bugzilla Id: 30970
Resolution Date: 08/Mar/08 07:38 PM


 Description  « Hide
I've included 3 patch files for changes I've made to the FTP andFTPClient
classes in the commons-net package.

The first patch is for the FTP class making it extend SocketClientinstead of
TelnetClient. I noticed that the behavior of theTelnetClient's input stream
reader thread was effectively ignoring thesocket's SOTimeout causing reads to
hang forever if the server decidednot to respond to a client request at all.
This should also answer oneof the goals from the TODO list:

"Divorce FTPClient from TelnetClient, getting rid of the TelnetClientthreads
which cause problems on some platforms (e.g., MacOS)."

The second patch is for an FTPTest unit test. I've covered most of thebasic
methods (connect(), disconnect(), sendCommand(), getReplyCode(),etc). Ignored
for now are the convenience methods since they all callsendCommand() underneath.
Part of the FTPTest class is a DummyFTPServerinner class which is used to
communicate to the test FTP class - don'tknow if that would be useful elsewhere
(maybe part of FTPClient unittests), so you might consider making it a utility
class for other unittests.

Finally I've attached a patch for minor changes to FTPClient:

  • changed __storeFile() from private to protected so that it can beused by
    classes that extend FTPClient
  • added __storeFile(String, String) method - so that the commands itaccepts are
    not limited to what's found in FTPCommand. Note: the__storeFile(int, String)
    method now calls the __storeFile(String,String) method.
  • added openDataConnection(String, String) method - so that thecommands it
    accepts are not limited to what's found in FTPCommand. Note:the
    openDataConnection(int, String) method now calls
    the_openDataConnection_(String, String) method.

Hopefully you'll find the changes agreeable and will incorporate theminto the
code base.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Joseph Hindsley added a comment - 01/Sep/04 02:26 AM
Created an attachment (id=12581)
FTP.java.patch.txt

Joseph Hindsley added a comment - 01/Sep/04 02:26 AM
Created an attachment (id=12582)
FTPTest.java.patch.txt

Joseph Hindsley added a comment - 01/Sep/04 02:27 AM
Created an attachment (id=12583)
FTPTest.java.patch.txt

Joseph Hindsley added a comment - 01/Sep/04 02:28 AM
Created an attachment (id=12584)
FTPClient.java.patch.txt

Joseph Hindsley added a comment - 01/Sep/04 02:29 AM
Sorry about the double FTPTest.java.patch.txt submission.

Rory Winston added a comment - 15/Apr/05 11:14 PM
Sorry Joseph, what I actually meant to do was mark this as LATER. I think you
have some good ideas in here, and will be taking a better look when I get some time.

Henri Yandell added a comment - 20/Sep/07 05:25 AM
Reopening - this was a Bugzilla LATER.