Last active
August 29, 2015 14:17
-
-
Save iugonet/6b3992a79f9a389759cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import org.apache.commons.lang3.SystemUtils; | |
class ExternalModel { | |
private String suffix; | |
private ArrayList<String> arrayList; | |
ExternalModel() { | |
arrayList = new ArrayList<String>(); | |
if (SystemUtils.IS_OS_WINDOWS) { | |
suffix = ".win64"; | |
} else if (SystemUtils.IS_OS_LINUX) { | |
suffix = ".linux64"; | |
} else if (SystemUtils.IS_OS_MAC) { | |
suffix = getClass().getSimpleName() + ".mac64"; | |
} | |
} | |
public void exec() { | |
String[] cmdArray = new String[arrayList.size()]; | |
try { | |
for (int i = 0; i < arrayList.size(); i++) { | |
cmdArray[i] = arrayList.get(i); | |
} | |
Process process = Runtime.getRuntime().exec(cmdArray, null, null); | |
} catch (Exception ex) { | |
ex.printStackTrace(); | |
} | |
} | |
public String getSuffix() { | |
return suffix; | |
} | |
public void setSuffix(String suffix) { | |
this.suffix = suffix; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment