Example #1
0
 public boolean vote(Issue issue) throws ServiceException {
   try {
     HttpPost post = new HttpPost(rootURL + "/issue/" + issue.getIssueId() + "/vote.json");
     HttpResponse response = execute(post);
     if (HttpStatus.SC_OK == response.getStatusLine().getStatusCode()) {
       issue.setVoted(true);
       issue.setVotes(issue.getVotes() + 1);
       return true;
     } else return false;
   } catch (IOException e) {
     throw new ServiceException(MSG_CONNECT_ERROR, e);
   }
 }