File tree Expand file tree Collapse file tree
src/main/java/org/kohsuke/github Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030import java .util .Collections ;
3131import java .util .Date ;
3232import java .util .List ;
33- import java .util .Locale ;
3433
3534/**
3635 * Represents an issue on GitHub.
@@ -100,7 +99,24 @@ public Date getUpdatedAt() {
10099 * Updates the issue by adding a comment.
101100 */
102101 public void comment (String message ) throws IOException {
103- new Poster (root ).withCredential ().with ("comment" ,message ).to ("/issues/comment/" +
104- owner .getOwnerName ()+"/" +owner .getName ()+"/" +number );
102+ new Poster (root ).withCredential ().with ("comment" ,message ).to (getApiRoute ("comment" ));
103+ }
104+
105+ /**
106+ * Closes this issue.
107+ */
108+ public void close () throws IOException {
109+ new Poster (root ).withCredential ().to (getApiRoute ("close" ));
110+ }
111+
112+ /**
113+ * Reopens this issue.
114+ */
115+ public void reopen () throws IOException {
116+ new Poster (root ).withCredential ().to (getApiRoute ("reopen" ));
117+ }
118+
119+ private String getApiRoute (String verb ) {
120+ return "/issues/" +verb +"/" +owner .getOwnerName ()+"/" +owner .getName ()+"/" +number ;
105121 }
106122}
You can’t perform that action at this time.
0 commit comments