Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FTP using java

 
Aditya Sirohi
Ranch Hand
Posts: 93
Eclipse IDE Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Folks,

I need to transfer file from one computer to another in the LAN. I saw some documents on FTP, can you let me how can i approach this problem? Do i need to write both client and server for this? I think if i start with a simple code that replicates file transfer using command line ( filetransfer.java C:\\test.txt [IP of the destination machine]), that would be a good start for me.

Thanks
Adi
 
Paul Clapham
Sheriff
Pie
Posts: 20750
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Who says you have to do it in Java? And why?

It's extremely unlikely that you would have to write the server in Java. If somebody says they're going to use FTP then it's extremely likely that they have an FTP server running already. Or if they don't have one, then there's one which came with their computer which they can just start up. So before you start rushing off to do something, find out what exactly you have to do and what you don't have to do.
 
Campbell Ritchie
Sheriff
Posts: 48396
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Too difficult a question for "beginning". Moving. Maybe Java™ in General, maybe General computing . . . not sure, but let's try general computing.
 
Victor Ramen
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aditya Sirohi wrote:Hello Folks,

I need to transfer file from one computer to another in the LAN. I saw some documents on FTP, can you let me how can i approach this problem? Do i need to write both client and server for this? I think if i start with a simple code that replicates file transfer using command line ( filetransfer.java C:\\test.txt [IP of the destination machine]), that would be a good start for me.

Thanks
Adi

Depends. Assuming server = source and client = destination, does the client trigger the FTP? i.e. Is it a pull mechanism? Or a push where server FTP-s without any request from the client.
In the former case, you need to write both client and server. In the latter case, only server.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would be inclined to use a 3rd part tool/lib. so Apache Commons Net if you're going to do it programatically.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic