I have the gui which have the button as "mount to server"....am having the ubuntu client and server system.....When I click the mount button ,it should mount to server folder... for example, one folder name "OUTPUT" is in the server..in client machine folder is "OUTPUT FILES"...through linux command i can mount the server "OUTPUT" folder from client folder "OUTPUT FILES".... But , in java when i press the mount button, it should mount the server "OUTPUT" folder..should i need any shellscript code?...how to do? and how to get the server system ip address?...can u plz anyone help me?
Asked
Active
Viewed 954 times
1 Answers
2
You can write a shell script to mount the server folder onto your client's filesystem. Once you have that working, you can just execute this shell script from Java code using Runtime class.
String IPAddress = "...";
String script= "/path/to/your/script.sh";
String[] cmd = {script, IPAddress};
Runtime rt = Runtime.getRuntime();
rt.exec(cmd);

Nishan
- 2,821
- 4
- 27
- 36
-
hi thanks.but in tat shell script which should have the ip address...how to specify the client ip address? – Sri Mar 10 '11 at 12:41
-
You could have the shell script take IP adrress as commandline parameter. And then pass on the IP from java. I have modified the code above for this. – Nishan Mar 10 '11 at 16:09