Groups are sets of users that can be used in collaborations.
Calling the static getAllGroups(BoxAPIConnection)
will
return an iterable that will page through all of the user's groups.
Iterable<BoxGroup.Info> groups = BoxGroup.getAllGroups(BoxAPIConnection api);
for (BoxGroup.Info groupInfo : groups) {
// Do something with the group.
}
The static createGroup(BoxAPIConnection, String)
method will
let you create a new group with a specified name.
BoxGroup.Info groupInfo = BoxGroup.createGroup(api, "My Group");
A group can be deleted by calling the delete()
method.
BoxGroup group = new BoxGroup(api, "id");
group.delete();