• Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating File on other System  RSS feed

 
Ketan Mohite
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

I am writing a Java application where I want to access a File which is on other machine(System).

For e.g. To create a file on the local machine I can use,
File file = new File("C:\\Temp\\test.txt");

But what if I want to create file in the same path, but on different System whose IP Address is say 10.1.1.1 or machine name is TestServer

Thanks & Regards,
Ketan
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the other machine is a Windows machine, you can use a shared volume. The jCIFS library (jcifs.samba.org) could be used for accessing a Samba server (or any other SMB volume).
 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, it is not very clear if you simply want to save a file in a path in another machine, or if you actually would like to transfer a file from one machine to the other.

In the latter case you could use a socket to transfer the file from the client to a server. Obviously, the user running the JVM for the server application must have privileges to write a file in the path that you want to save the file.

However, if what you ask is how to save a file in a different path on another machine, then, probably all you need to do is to share some resources over your network, like the previous post seems to suggest.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!