• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

passing a file object between two remote systems using RMI

 
s ravi chandran
Ranch Hand
Posts: 352
Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

Can we pass a file object between two remote systems using RMI by any means?

thanks
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming you are talking about a java.io.File object - the "abstract representation of directory and file pathnames" - well File is serializable so you could pass it, but why would you want to since I don't see how those names could be meaningful on the receiving system.

Bill
 
s ravi chandran
Ranch Hand
Posts: 352
Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for replying. well, it's not only the name, but i need the complete file on the other system. there is an existing application based on RMI, I have to add few things to it. They are saying that they will be passing files from their client machine, I need to process it and send it to some other business processing layer. I don't know how they actually pass the file, as I see it, even if we serialize a file object, we would only get the file attribute with the reference and not the content, so it is looking really odd to me.

I wanted to know if it is possible by some means, something which I may not be knowing about object reference or file object reference to be specific. is there a way to get a file remotely along with a content using RMI? logically it seems to be contrary to the object reference working itself.

thanks
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please clarify - do you really need to physically move the file from machine A to machine B so machine B can work on it or would reading the file as a stream (say with sockets) from machine A be sufficient?

How much control do you have over machines A and B?

Hopefully you now realize that moving a File object is not what you want.

Bill
 
s ravi chandran
Ranch Hand
Posts: 352
Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
File movement is not a requirement. Reading the file and its content would be sufficient. RMI is used in the existing architecture, so I can't design anything more suitable for this requirement. a client system will be sending an array of files to the server, at the server I should have the file and the content, which I can process further according to the business process.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just did a google search for "java rmi file streaming" - a couple of potentially useful references popped up, including a recent one on sourceforge.

Bill
 
s ravi chandran
Ranch Hand
Posts: 352
Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William Brogden wrote:I just did a google search for "java rmi file streaming" - a couple of potentially useful references popped up, including a recent one on sourceforge.

Bill


thanks for the reply. I will check it out. This can be a good solution. Only issue I see it that if I use inputstream concept, then I will have to tell the client to pass the inputstream in place of the file array, that is upto them to agree or not. If they are fine with it, then some headache will be removed from my end..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic