Changeset 925


Ignore:
Timestamp:
Nov 10, 2010, 5:52:10 PM (7 years ago)
Author:
stefan
Message:

simplify

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/ProcessUtil.java

    r812 r925  
    2727
    2828  public static Process exec(String command, File dir) throws IOException {
    29     Process process;
    30 
    31     ArrayList<String> env = new ArrayList<String>();
    32     for (Map.Entry<String, String> entry : System.getenv().entrySet()) {
    33       if (entry.getKey().equalsIgnoreCase("PWD")) continue;
    34       env.add(entry.getKey() + "=" + entry.getValue());
    35     }
    36     String[] envArray = new String[env.size()];
    37     env.toArray(envArray);
    38 
    3929    ArrayList<String> list = StringUtils.tokenize(command);
    4030    String[] array = new String[list.size()];
    4131    list.toArray(array);
    4232
    43     process = Runtime.getRuntime().exec(array, envArray, dir);
    44 
    45     return process;
     33    return exec(array, dir);
    4634  }
    4735}
Note: See TracChangeset for help on using the changeset viewer.