problem in executing linux command
Hope you all will be fine. I used this code to run Linux command and it worked fine.
But now i want to run the same command with the different path. The problem is one of the path parameter i am getting from the method. So the problem is, how i write the path
Process myProcess = Runtime.getRuntime().exec("chmod 755 //test//msg0000.wav" );
As you see the inverted commas end at "brights//", and this indicates that command is finishing here but it's not the case. I want that whole thing is written in single inverted commas so it become full path and the command is executed on the defined path. Like
Process myProcess = Runtime.getRuntime().exec("chmod 755 //var//spool//asterisk//voicemail//brights//" + getOnlyMailBox() + "//INBOX//msg0000.wav");
But in this case i have no way to get the value because it is treated as a whole string(constant).
Process myProcess = Runtime.getRuntime().exec("chmod 755 //var//spool//asterisk//voicemail//brights// getOnlyMailBox() //INBOX//msg0000.wav");
So can any one tell me how can i give path here so the command execute. Whatever value getOnlyMailBox() receive , substitute here and then it becomes a full path and then command execute on this path.