@Override
    public void execute(String command) throws CommandExecutionException {
        System.out.println("Execution: " + command);

        Validate.notEmpty(command, "Command line must be not empty.");

        Process process = null;
        Throwable throwable = null;

        try {
            process = Runtime.getRuntime().exec(command);

            startReaderThread(process.getInputStream(), System.out, "STDOUT: ");
            startReaderThread(process.getErrorStream(), System.err, "STDERR: ");

            int returnCode = process.waitFor();
            if (returnCode != 0) {
                throw new IllegalStateException(String.format("Command '%s' return %d\n", command, returnCode));
            }

        } catch (IOException e) {
            throwable = e;
            throw new CommandExecutionException(e);
        } catch (InterruptedException e) {
            throwable = e;
            process.destroy();
            throw new CommandExecutionException(e);
        } finally {
            try {
                closeProcessStreams(process);
            } catch (IOException e) {
                if (throwable == null) {
                    throw new CommandExecutionException(e);
                }
            }

        }
    }