1 24 package org.riotfamily.common.io; 25 26 import java.io.IOException ; 27 import java.util.List ; 28 29 import org.springframework.util.StringUtils; 30 31 36 public final class CommandUtils { 37 38 private CommandUtils() { 39 } 40 41 public static String exec(String executable) throws IOException { 42 return new RuntimeCommand(new String [] {executable}).exec().getResult(); 43 } 44 45 public static String exec(String executable, String arg) throws IOException { 46 return new RuntimeCommand(new String [] {executable, arg}).exec().getResult(); 47 } 48 49 public static String exec(List commandLine) throws IOException { 50 return new RuntimeCommand(StringUtils.toStringArray(commandLine)).exec().getResult(); 51 } 52 53 public static String exec(String [] commandLine) throws IOException { 54 return new RuntimeCommand(commandLine).exec().getResult(); 55 } 56 57 } 58 | Popular Tags |