This content has been marked as final. Show 6 replies
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?
You can find the API here
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.
Hi, I downloaded JDK1.4 but could not find the API
doc for the ftp client class sun.net.ftp.FtpClient. I
could see the compiled class though.