return new Result(response.toString(), error);
return new Result(isr.getResult(), esr.getResult());
    public final static Result execute(String[] command, String[] envp, File dir, long timeout)            throws IOException, ERXTimeoutException {        File outputFile = null;        Runtime rt = Runtime.getRuntime();        Process p = null;        int exitValue = 0;        StringBuffer response = new StringBuffer();        String input = "";        String error = "";        try {            if (log.isDebugEnabled()) {                log.debug("will execute command " + command);            }            if (dir == null && envp == null) {                p = rt.exec(command);            } else if (dir == null) {                p = rt.exec(command, envp);            } else if (envp == null) {                throw new IllegalArgumentException("if dir != null then envp must also be != null");            } else {                p = rt.exec(command, envp, dir);            }            if (timeout > 0) {                final Process pp = p;                TimeoutTimerTask task = new TimeoutTimerTask(p);                Timer timer = new Timer();                timer.schedule(task, timeout);                try {                    p.waitFor();                } catch (InterruptedException ex) {                }                timer.cancel();                if (task.hasTimeout()) {                    throw new ERXTimeoutException("process did't exit after " + timeout + " milliseconds");                }            } else {                // wait for the result of the process                try {                    p.waitFor();                } catch (InterruptedException ex) {                }            }            response.append(ERXFileUtilities.stringFromInputStream(p.getInputStream()));        } finally {            try {                if (p != null && exitValue == 0) {                    InputStream is = p.getErrorStream();                    if (is != null) error = ERXFileUtilities.stringFromInputStream(is);                        if (log.isDebugEnabled()) {                        log.debug("response = " + response);                        log.debug("error = " + error);                    }                    freeProcessResources(p);                }            } catch (NullPointerException e) {                // p was null            }            if (outputFile != null) outputFile.delete();        }        return new Result(response.toString(), error);    }