Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Transfering files from one Linux System to another  RSS feed

 
Chandhrasekar Saravanan
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I like transfer files from one Linux system to another, i know the easiest way is to use ftp.
is there any other way , that we could use to
transfer file from one Linux system to another using java
Thanks
Regards
Chandhrasekar Saravanan
 
A.Perdomo
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check Java Servlet Programming, O'Reilly, Jason Hunter.
There, I found very usefull code to implement a file transfer process. But following that experience, maybe you must consider another way to do that as MQ.

A.Perdomo.
 
Chandhrasekar Saravanan
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I couldnt understand what MQ is. could any one
suggest me whether there are any other ways we could transfer files from one linux system to other
I like to know what strategy could be used in transfering files from one linux to other
 
Paul Cowan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You want to transfer a file between 2 linux machines. Does it have to be using Java?
If you can't use FTP, you could use SSH, or you can use NFS to mount one of the machines and create a virtual directory.
If you want to write it in Java, you would have a client that would probably take a command line name of the file, read it into a byte array, then connect a server conponent and write it across a stream through the socket connection. You could do this simply using an ObjectOutputStream.
The server component would create a ServerSocket, accept connections, read Objects from an ObjectInputStream, and write the data to disk using a FileOutputStream.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!