@Override public List<Comment> getComments() { final List<Comment> found = new ArrayList<>(); try { final List<GitlabNote> notes = gitlabApi.getAllNotes(mergeRequest); for (final GitlabNote note : notes) { final String identifier = note.getId() + ""; final String content = note.getBody(); final String type = "PR"; final List<String> specifics = new ArrayList<>(); final Comment comment = new Comment(identifier, content, type, specifics); found.add(comment); } } catch (final Throwable e) { violationsLogger.log(SEVERE, "Could not get comments", e); } return found; }
/** * Delete an Issue Note * * @param projectId The project id * @param issueId The issue id * @param noteToDelete The note to delete * @throws IOException on gitlab api call error */ public void deleteNote(Serializable projectId, Integer issueId, GitlabNote noteToDelete) throws IOException { String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabIssue.URL + "/" + issueId + GitlabNote.URL + "/" + noteToDelete.getId(); retrieve().method(DELETE).to(tailUrl, GitlabNote.class); }
/** * Delete an Issue Note * * @param projectId The project id * @param issueId The issue id * @param noteToDelete The note to delete * @throws IOException on gitlab api call error */ public void deleteNote(Serializable projectId, Integer issueId, GitlabNote noteToDelete) throws IOException { String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabIssue.URL + "/" + issueId + GitlabNote.URL + "/" + noteToDelete.getId(); retrieve().method(DELETE).to(tailUrl, GitlabNote.class); }
/** * Delete an Issue Note * * @param projectId The project id * @param issueId The issue id * @param noteToDelete The note to delete * @throws IOException on gitlab api call error */ public void deleteNote(Serializable projectId, Integer issueId, GitlabNote noteToDelete) throws IOException { String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabIssue.URL + "/" + issueId + GitlabNote.URL + "/" + noteToDelete.getId(); retrieve().method(DELETE).to(tailUrl, GitlabNote.class); }
/** * Delete a Merge Request Note * * @param mergeRequest The merge request * @param noteToDelete The note to delete * @throws IOException on gitlab api call error */ public void deleteNote(GitlabMergeRequest mergeRequest, GitlabNote noteToDelete) throws IOException { String tailUrl = GitlabProject.URL + "/" + mergeRequest.getProjectId() + GitlabMergeRequest.URL + "/" + mergeRequest.getIid() + GitlabNote.URL + "/" + noteToDelete.getId(); retrieve().method(DELETE).to(tailUrl, GitlabNote.class); }
/** * Delete a Merge Request Note * * @param mergeRequest The merge request * @param noteToDelete The note to delete * @throws IOException on gitlab api call error */ public void deleteNote(GitlabMergeRequest mergeRequest, GitlabNote noteToDelete) throws IOException { String tailUrl = GitlabProject.URL + "/" + mergeRequest.getProjectId() + GitlabMergeRequest.URL + "/" + mergeRequest.getIid() + GitlabNote.URL + "/" + noteToDelete.getId(); retrieve().method(DELETE).to(tailUrl, GitlabNote.class); }
/** * Delete a Merge Request Note * * @param mergeRequest The merge request * @param noteToDelete The note to delete * @throws IOException on gitlab api call error */ public void deleteNote(GitlabMergeRequest mergeRequest, GitlabNote noteToDelete) throws IOException { String tailUrl = GitlabProject.URL + "/" + mergeRequest.getProjectId() + GitlabMergeRequest.URL + "/" + mergeRequest.getIid() + GitlabNote.URL + "/" + noteToDelete.getId(); retrieve().method(DELETE).to(tailUrl, GitlabNote.class); }