sun.* classes are implementation 'artifacts', they are not part of the API and subject to change without notice with newer versions.
That said, I admit already having used a sun.* class to some purpose.
javap is lurking around there waiting to strike down.
java.net.URL and java.net.URLConnection are the public APIs to access ftp resources, eg:-
String loc = "ftp://user:password@server/%2Fetc/motd;type=a";
URLConnection uc = (new URL(loc)).openConnection();
If you want to download the file then call URLConnection's getInputStream() method. If you want to upload you call getOutputStream() method and write to the output stream.
How can I download a list of files (rather than 1) from remote FTP server? If I read the content of URLConnection's getInputStream() method, will I get the list of file names, or the file content of all files?
I am having a problem with sun.net.ftp.FtpClient :: closeServer() method. Whenever I use this function it hangs and doesn't return for a long time. It doesn't throw any exception(s) and dies with FTP reply error.