0

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?

1
  • Do you want to do this (mount stuff) daily? Commented Mar 10, 2011 at 9:08

1 Answer 1

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);
Sign up to request clarification or add additional context in comments.

2 Comments

hi thanks.but in tat shell script which should have the ip address...how to specify the client ip address?
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.