View Javadoc

1   // %2670312793:hoplugins.teamAnalyzer.executor%
2   package hoplugins.teamAnalyzer.executor;
3   
4   import java.io.File;
5   
6   
7   /***
8    * Class that may launch a script under unix OS
9    *
10   * @author <a href=mailto:draghetto@users.sourceforge.net>Massimiliano Amato</a>
11   */
12  public class UnixExec {
13      //~ Methods ------------------------------------------------------------------------------------
14  
15      /***
16       * Show the guide by calling the proper script
17       *
18       * @param cmd the command
19       *
20       * @return true if guide was open
21       */
22      public static boolean showGuide(String[] cmd) {
23          try {
24              File f = new File("./hoplugins/teamAnalyzer/guide/" + cmd[2] + ".doc");
25  
26              if (!f.exists()) {
27                  cmd[2] = "English";
28              }
29  
30              Runtime rt = Runtime.getRuntime();
31              Process proc = rt.exec(cmd);
32  
33              return (proc.waitFor() == 0) ? true : false;
34          } catch (Throwable t) {
35              return false;
36          }
37      }
38  }