1

I have an older project that uses the sun.net.ftp.FtpClient class to download a file from an ftp server. It appears that Oracle has finally removed this unsupported/deprecated feature from Java. Any suggestions on what should be used to replace it? I was considering org.apache classes but I have never used them. The best solution would be the simplest.

Kevin Panko
  • 8,356
  • 19
  • 50
  • 61
Jay
  • 288
  • 3
  • 13
  • 1
    What makes you think Oracle removed those classes? Even though you should avoid using sun.* classes (it's clearly a bad practice) i'd be surprised if Sun/Oracle actually removed those. What JDK version do you use? – Richard Kettelerij Aug 26 '10 at 19:34
  • Yes, I know it is a bad practice. I am just trying to keep this barely used project working until I can kill it. My JDK is still j6u20 and I have a test machine running the j6u21 JRE. Perhaps it was renamed to oracle.net.ftp? – Jay Aug 26 '10 at 19:53
  • Even with the update 21 JDK it is still broke. – Jay Aug 26 '10 at 20:30

2 Answers2

5

Dependending on your requirements i'd recommend to use either the FTP client provided by Apache Commons Net or edtFTP/j.

Richard Kettelerij
  • 2,049
  • 14
  • 17
  • I ended up using the org.apache.commons.net package as it is looks to be well supported and pretty easy to use. – Jay Aug 29 '10 at 21:19
0

finj - FTP Client for Java Apps


What is finj ?

Sun provides a FTP client written in Java as part of the standard classes. Unfortunately, since the sun.net.ftp.* classes are not part of the java.* packages, neither the source code nor a complete API are available.

The goal of this project is to provide to developers a complete, well designed, programmatically controllable Open-Source FTP client written in the Java language. finj then simply stands for 'FTP in Java'.


It provides an API similar to sun.net.ftp.FtpClient so that you can use it without changing your code very much.

Kevin Panko
  • 8,356
  • 19
  • 50
  • 61