Connecting/logging/interacting with an FTP site using Java ?
There is an FTP server where I work that is within the company network. Clients send us files to our FTP server and our program routes files to certain locations within the network. Currently, I reference and access the FTP machine through mapped drives (i.e. drive letters) - that's how I access the files. But, now they're looking to have the FTP hosted (outsourced) since we've been having way too many network interruptions and trouble with our FTP in general. Herein lies my problem - since the FTP server would be outsourced and outside of our network, I no longer can access the machine through mapped drives but would have to make a program to log onto an FTP site remotely (across the internet using name/password etc) to access files that clients send us. I've looked in the standard Java API and it doesn't seem like there are any standard FTP connection classes in the JDK. The original option would have to be building it from scratch which probably would have to deal with socket/port programming which I really have no clue about.
Has anyone done something like this before? Are there standard (not contained in the standard Java API) open source classes that serve such a purpose? Thanks.
Has anyone done something like this before? Are there standard (not contained in the standard Java API) open source classes that serve such a purpose? Thanks.
It's not part of the standard java package, but Sun does provide it. In a package called sun.net.ftp or com.sun.net.ftp or something like that. I used it once before, but couldn't find my old class for some reason. Let me continue looking around.
FTP protocol (active) is not something you really want to manually do yourself with sockets programming. Too tedious.
FTP protocol (active) is not something you really want to manually do yourself with sockets programming. Too tedious.
http://www.experts-exchange.com/Programmin...Q_20421069.html
This might be helpful. I found my code, but nothing useful there really. I think sun.net.ftp.FtpClient doesn't let you delete files though, 'cos I subclassed it and added a "delete" method (don't see why I'd have done that if the super class did it out of the box).
This might be helpful. I found my code, but nothing useful there really. I think sun.net.ftp.FtpClient doesn't let you delete files though, 'cos I subclassed it and added a "delete" method (don't see why I'd have done that if the super class did it out of the box).
You may also look into thrid party APIs. I used the Netscape libraires to build up email functionalities in pieces of software I've used in the past. There are tons of open source libraries that can help you. You may just have to install the client software on your machine and run hooks into it from your application. If they (your client) aren't against it you could also look into using the http/s to transfer the files.
Rice
Rice
I am not exactly sure of why you need to make a program to log onto an ftp site when all you have to do is type ftp://blahblahblah in your address bar then enter username/password.
Trending Topics
Originally posted by 1a-race
I am not exactly sure of why you need to make a program to log onto an ftp site when all you have to do is type ftp://blahblahblah in your address bar then enter username/password.
I am not exactly sure of why you need to make a program to log onto an ftp site when all you have to do is type ftp://blahblahblah in your address bar then enter username/password.

Rice
Originally posted by 1a-race
I am not exactly sure of why you need to make a program to log onto an ftp site when all you have to do is type ftp://blahblahblah in your address bar then enter username/password.
I am not exactly sure of why you need to make a program to log onto an ftp site when all you have to do is type ftp://blahblahblah in your address bar then enter username/password.
You can even use ftp://user:mypassword@blah.blah.blah so you don't have to type user/pw each time.






