1 26 30 package org.omg.lifl.eclipse.plugin.utils; 31 32 import java.io.IOException ; 33 34 38 public class OSHelper { 39 40 public static boolean isWindowsOS() { 41 String os = System.getProperties().getProperty("os.name"); 42 if (os.startsWith("Windows")) 43 return true; 44 else 45 return false; 46 47 } 48 49 public static boolean isLinuxOS() { 50 String os = System.getProperties().getProperty("os.name"); 51 if (os.startsWith("Linux")) 52 return true; 53 else 54 return false; 55 56 } 57 58 public static boolean isOS(String OSName) { 59 String os = System.getProperties().getProperty("os.name"); 60 if (os.startsWith("OSName")) 61 return true; 62 else 63 return false; 64 65 } 66 67 public static void launchProcess(String srciptCmd) throws IOException { 68 Process process; 69 process = Runtime.getRuntime().exec(srciptCmd); 70 71 105 } 106 107 public static String createWin32Shell() { 108 String shellTittle = " \"Shell\" "; 109 String cmdDirectory = WorkBenchHelper.getSelectedRessourceFullPath(); 110 if (cmdDirectory == null) 111 cmdDirectory = "."; 112 String win32Shell = "cmd.exe /c start /D " + cmdDirectory + shellTittle; 113 return win32Shell; 114 } 115 116 117 } 118 | Popular Tags |