public static boolean checkString(String t) {
for(char ch : t.toCharArray()) {
- if((ch >= 'a' && ch <= 'z') ||
- (ch >= 'A' && ch <= 'Z') ||
- (ch >='0' && ch <= '9') ||
+ if((ch >= 'a' && ch <= 'z') ||
+ (ch >= 'A' && ch <= 'Z') ||
+ (ch >='0' && ch <= '9') ||
(ch == '-') || (ch == '_')) {
continue;
} else {
isWindows = true;
t = t.toLowerCase();
}
- VMProperty[] properties = (VMProperty[])EmulatorVMList.getInstance().getProperties();
+ VMProperty[] properties = EmulatorVMList.getInstance().getProperties();
for (VMProperty p : properties) {
if (isWindows ) {
if (p.getName().toLowerCase().equals(t)) {
layout.marginRight = 0;
layout.marginTop = 0;
layout.marginWidth = 0;
-
+
return layout;
}
*/
}
}
-
public static ProcessResult runProcess(List<String> cmd) {
+ return runProcess(cmd, null);
+ }
+
+ public static ProcessResult runProcess(List<String> cmd, File directory) {
ProcessResult result = new ProcessResult();
ProcessBuilder pb = new ProcessBuilder(cmd);
int exitValue = 0;
- Process process;
+ Process process = null;
+
+ if (directory != null) {
+ pb.directory(directory);
+ }
+
try {
process = pb.start();
List<String> stdOut = ProcessOutputReader.readStdOut(process, cmd.toString());