KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > quikj > application > utilities > postinstall > ScriptExecutor


1 /*
2  * ScriptExecutor.java
3  *
4  * Created on October 16, 2003, 6:51 AM
5  */

6
7 package com.quikj.application.utilities.postinstall;
8
9 /**
10  *
11  * @author amit
12  */

13 public class ScriptExecutor
14 {
15     
16     /** Creates a new instance of ScriptExecutor */
17     public ScriptExecutor()
18     {
19     }
20     
21     public static String JavaDoc executeUnixInitScript(String JavaDoc ace_folder,
22     ScreenPrinterInterface out)
23     {
24         try
25         {
26             String JavaDoc exec_path = "/bin/sh "
27             + ace_folder + "/bin/init";
28             out.println("# " + exec_path + "...");
29             Process JavaDoc p = Runtime.getRuntime().exec(exec_path);
30             p.waitFor();
31             
32             exec_path = "/bin/sh "
33             + ace_folder + "/bin/fix_perms.sh";
34             out.println("# " + exec_path + "...");
35             p = Runtime.getRuntime().exec(exec_path);
36             p.waitFor();
37         }
38         catch (Exception JavaDoc ex)
39         {
40             return "Failed to run the shell scripts";
41         }
42         
43         return null;
44     }
45 }
46
Popular Tags