added missing repository delete operation

This commit is contained in:
Kohsuke Kawaguchi
2012-06-18 12:50:40 -07:00
parent 926202900c
commit 45eae77f8f

View File

@@ -272,7 +272,7 @@ public class GHRepository {
private void edit(String key, String value) throws IOException {
Poster poster = new Poster(root).withCredential();
if (!key.equals("name"))
poster.with("name",name); // even when we don't change the name, we need to send it in
poster.with("name", name); // even when we don't change the name, we need to send it in
poster.with(key, value)
.to("/repos/" + owner.login + "/" + name, null, "PATCH");
}
@@ -314,12 +314,7 @@ public class GHRepository {
* Deletes this repository.
*/
public void delete() throws IOException {
throw new UnsupportedOperationException(); // doesn't appear to be available in V3
// Poster poster = new Poster(root).withCredential();
// String url = "/repos/delete/" + owner.login +"/"+name;
//
// DeleteToken token = poster.to(url, DeleteToken.class);
// poster.with("delete_token", token.delete_token).to(url);
new Poster(root).withCredential().to("/repos/" + owner.login +"/"+name, null, "DELETE");
}
/**