public void handlePost() {
final Request request = getRequest();
final String resource = RESTUtils.getStringAttribute(getRequest(), "resource");
checkArgument("run-command".equals(resource), "Invalid entry point. Expected: run-command.");
JsonParser parser = new JsonParser();
InputRepresentation entityAsObject = (InputRepresentation) request.getEntity();
JsonObject json;
try {
InputStream stream = entityAsObject.getStream();
InputStreamReader reader = new InputStreamReader(stream);
json = (JsonObject) parser.parse(reader);
} catch (Exception e) {
throw Throwables.propagate(e);
}