BrightSide Workbench Full Report + Source Code
org.turro.wd.common.entities.WdRuntime Class Reference

Static Public Member Functions

static void launch (String program)
 
static void launch (String program, String params)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 24 of file WdRuntime.java.

Member Function Documentation

◆ launch() [1/2]

static void org.turro.wd.common.entities.WdRuntime.launch ( String  program)
static

Definition at line 26 of file WdRuntime.java.

26  {
27  launch(program, null);
28  }
static void launch(String program)
Definition: WdRuntime.java:26

◆ launch() [2/2]

static void org.turro.wd.common.entities.WdRuntime.launch ( String  program,
String  params 
)
static

Definition at line 30 of file WdRuntime.java.

30  {
31  String os = System.getProperty("os.name");
32  try {
33  if("Windows 2000".equals(os) && !(program.startsWith("http:") || program.startsWith("file:")))
34  Runtime.getRuntime().exec(
35  new String[] {
36  "cmd",
37  "/c",
38  program.replaceAll(" ", "^ ") + (params != null ? params : "")
39  });
40  else if(os != null && os.indexOf("Windows") > -1)
41  Runtime.getRuntime().exec(
42  new String[] {
43  "cmd",
44  "/c",
45  "start",
46  "\"\"",
47  program + (params != null ? " " + params : "")
48  });
49 // Runtime.getRuntime().exec(
50 // "start " + program +
51 // (params != null ? params : "")
52 // );
53  else if(os != null && os.indexOf("Linux") > -1) {
54  Runtime.getRuntime().exec(
55  new String[] {
56  "xdg-open",
57  program + (params != null ? " " + params : "")
58  });
59 
60  }
61  } catch(Exception ex) {
62  java.util.logging.Logger.getLogger("turroclient").log(
63  java.util.logging.Level.SEVERE,
64  "TurroRuntime.execute",
65  ex
66  );
67  }
68  }

The documentation for this class was generated from the following file: