use of com.box.sdk.BoxAPIException in project camel by apache.
the class BoxGroupsManager method getGroupMembershipInfo.
/**
* Get group membership information.
*
* @param groupMemebershipId
* - the id of group membership.
* @return The group information.
*/
public BoxGroupMembership.Info getGroupMembershipInfo(String groupMemebershipId) {
try {
LOG.debug("Getting info for groupMemebership(id=" + groupMemebershipId + ")");
if (groupMemebershipId == null) {
throw new IllegalArgumentException("Parameter 'groupMemebershipId' can not be null");
}
BoxGroupMembership group = new BoxGroupMembership(boxConnection, groupMemebershipId);
return group.getInfo();
} catch (BoxAPIException e) {
throw new RuntimeException(String.format("Box API returned the error code %d\n\n%s", e.getResponseCode(), e.getResponse()), e);
}
}
use of com.box.sdk.BoxAPIException in project camel by apache.
the class BoxGroupsManager method deleteGroup.
/**
* Delete group.
*
* @param groupId
* - the id of group to delete.
*/
public void deleteGroup(String groupId) {
try {
LOG.debug("Deleting group(" + groupId + ")");
if (groupId == null) {
throw new IllegalArgumentException("Parameter 'groupId' can not be null");
}
BoxGroup group = new BoxGroup(boxConnection, groupId);
group.delete();
} catch (BoxAPIException e) {
throw new RuntimeException(String.format("Box API returned the error code %d\n\n%s", e.getResponseCode(), e.getResponse()), e);
}
}
use of com.box.sdk.BoxAPIException in project camel by apache.
the class BoxGroupsManager method getGroupMemberships.
/**
* Get information about all of the group memberships for this group.
*
* @param groupId
* - the id of group.
* @return The group information.
*/
public Collection<BoxGroupMembership.Info> getGroupMemberships(String groupId) {
try {
LOG.debug("Getting information about all memberships for group(id=" + groupId + ")");
if (groupId == null) {
throw new IllegalArgumentException("Parameter 'groupId' can not be null");
}
BoxGroup group = new BoxGroup(boxConnection, groupId);
return group.getMemberships();
} catch (BoxAPIException e) {
throw new RuntimeException(String.format("Box API returned the error code %d\n\n%s", e.getResponseCode(), e.getResponse()), e);
}
}
use of com.box.sdk.BoxAPIException in project camel by apache.
the class BoxGroupsManager method getGroupInfo.
/**
* Get group information.
*
* @param groupId
* - the id of group.
* @return The group information.
*/
public BoxGroup.Info getGroupInfo(String groupId) {
try {
LOG.debug("Getting info for group(id=" + groupId + ")");
if (groupId == null) {
throw new IllegalArgumentException("Parameter 'groupId' can not be null");
}
BoxGroup group = new BoxGroup(boxConnection, groupId);
return group.getInfo();
} catch (BoxAPIException e) {
throw new RuntimeException(String.format("Box API returned the error code %d\n\n%s", e.getResponseCode(), e.getResponse()), e);
}
}
use of com.box.sdk.BoxAPIException in project camel by apache.
the class BoxGroupsManager method updateGroupMembershipInfo.
/**
* Update group membership information.
*
* @param groupMembershipId
* - the id of group membership to update.
* @param info
* - the updated information.
* @return The group information.
*/
public BoxGroupMembership updateGroupMembershipInfo(String groupMemebershipId, BoxGroupMembership.Info info) {
try {
LOG.debug("Updating info for groupMembership(id=" + groupMemebershipId + ")");
if (groupMemebershipId == null) {
throw new IllegalArgumentException("Parameter 'groupMemebershipId' can not be null");
}
if (info == null) {
throw new IllegalArgumentException("Parameter 'info' can not be null");
}
BoxGroupMembership groupMembership = new BoxGroupMembership(boxConnection, groupMemebershipId);
groupMembership.updateInfo(info);
return groupMembership;
} catch (BoxAPIException e) {
throw new RuntimeException(String.format("Box API returned the error code %d\n\n%s", e.getResponseCode(), e.getResponse()), e);
}
}
Aggregations