コード例 #1
0
 private void modifyCollaborators(Collection<GHUser> users, String method) throws IOException {
   verifyMine();
   for (GHUser user : users) {
     new Requester(root)
         .method(method)
         .to("/repos/" + owner.login + "/" + name + "/collaborators/" + user.getLogin());
   }
 }
コード例 #2
0
 /** Gets the collaborators on this repository. This set always appear to include the owner. */
 @WithBridgeMethods(Set.class)
 public GHPersonSet<GHUser> getCollaborators() throws IOException {
   return new GHPersonSet<GHUser>(
       GHUser.wrap(
           root.retrieve()
               .to("/repos/" + owner.login + "/" + name + "/collaborators", GHUser[].class),
           root));
 }
コード例 #3
0
 /**
  * Gets the names of the collaborators on this repository. This method deviates from the principle
  * of this library but it works a lot faster than {@link #getCollaborators()}.
  */
 public Set<String> getCollaboratorNames() throws IOException {
   Set<String> r = new HashSet<String>();
   for (GHUser u :
       GHUser.wrap(
           root.retrieve()
               .to("/repos/" + owner.login + "/" + name + "/collaborators", GHUser[].class),
           root)) r.add(u.login);
   return r;
 }