class ShellCommandUtils {

    public String executeCommand(String command) {
        Writer output = new StringWriter();
        try {
            Process p = Runtime.getRuntime().exec(command);
            p.waitFor();
            IOUtils.copy(p.getInputStream(), output);
        } catch (IOException | InterruptedException e) {
            logger.error(String.format("An error happened while executing command[%s]", command), e);
        }
        return output.toString();
    }

}