Java File Transfer
Iam a novice to java programming. I have to access a remote system in my LAN and transfer a CSV file from that machine to my system.
Also since that file is big I have to split it into small files of 1000 lines each and move it to my system.I have to use FTP to do it. I should have an option to give the file location in my program so that i can dynamically change it according to the changes in the actual file location in the remote machine.
How can i accomplish this using java? Can anyone offer any help on this?
We are using Tomcat server on our network.
First you should become familiar with how to use FTP. Read the doc on how to use it and use it a few times manually to see how it goes. Also get RFC 959 which describes FTP.
If your program is expected to be an FTP client and issue use the FTP protocol to communicate with the server, you'll want to look at using Sockets. Perhaps there are higher level classes that will do more of the work, otherwise you'll need to write them yourself.
Firstly write a simple FTP client that can get a small file from the server and copy it to your harddrive, then move to the more complex requirements.
Why re-invent the wheel and write a FTP client ?
Just download an already existing FTP module .. for instance..Apache common's tool jar from..
Add it to the classpath and use it in your program.It is as simple as invoking sendFiles() and getFiles() on the FTPClient class in the library.
Last edited by ramper; 08-11-2005 at 03:22 PM.
Last Post: 11-27-2008, 02:13 AM
By Catalyst Development Corporation in forum vb.announcements
Last Post: 01-07-2003, 10:58 AM
By Glen Kunene in forum Talk to the Editors
Last Post: 03-23-2002, 12:43 AM
Last Post: 09-01-2000, 08:36 AM
By JJ in forum Enterprise
Last Post: 07-06-2000, 04:50 AM
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center