
On Thu, Apr 16, 2009 at 4:41 PM, Duggan Kim <mdkimani@gmail.com> wrote:
process. The server and client communicate via RMI, but to open a file, I am using:
Process p = Runtime.getRuntime().exec("cmd /c start '+ path);
the path provided by the server cannot be used by the client to open the right file. How else can this be done?
The client should not be trying to open a file directly on the server -- you need the server to return the file to your client as a binary stream. Secondly, using RMI is a very bad idea for various reasons -- insecure (you are executing arbitrary code on the remote computer), non-portable (the code above wont work on non-windows computers), slow (rmi socket negotiation is slow...), and RMI will probably not work over firewalls. RMI was fashionable in the 90s when the predominantly used communication protocols were com/dcom/corba... I suggest you dont use this and try something that works over standard protocols (e.g. http) Jxta (mentioned in an earlier email) or do a googel search for "p2p framework" to get you started.