Search in sources :

Example 1 with BoxCollaboration

use of com.box.sdk.BoxCollaboration in project camel by apache.

the class BoxCollaborationsManager method getCollaborationInfo.

/**
     * Get collaboration information.
     * 
     * @param collaborationId
     *            - the id of collaboration.
     * @return The collaboration information.
     */
public BoxCollaboration.Info getCollaborationInfo(String collaborationId) {
    try {
        LOG.debug("Getting info for collaboration(id=" + collaborationId + ")");
        if (collaborationId == null) {
            throw new IllegalArgumentException("Parameter 'collaborationId' can not be null");
        }
        BoxCollaboration collaboration = new BoxCollaboration(boxConnection, collaborationId);
        return collaboration.getInfo();
    } catch (BoxAPIException e) {
        throw new RuntimeException(String.format("Box API returned the error code %d\n\n%s", e.getResponseCode(), e.getResponse()), e);
    }
}
Also used : BoxAPIException(com.box.sdk.BoxAPIException) BoxCollaboration(com.box.sdk.BoxCollaboration)

Example 2 with BoxCollaboration

use of com.box.sdk.BoxCollaboration in project camel by apache.

the class BoxCollaborationsManager method updateCollaborationInfo.

/**
     * Update collaboration information.
     * 
     * @param collaborationId
     *            - the id of collaboration.
     * @return The collaboration with updated information.
     */
public BoxCollaboration updateCollaborationInfo(String collaborationId, BoxCollaboration.Info info) {
    try {
        LOG.debug("Updating info for collaboration(id=" + collaborationId + ")");
        if (collaborationId == null) {
            throw new IllegalArgumentException("Parameter 'collaborationId' can not be null");
        }
        BoxCollaboration collaboration = new BoxCollaboration(boxConnection, collaborationId);
        collaboration.updateInfo(info);
        return collaboration;
    } catch (BoxAPIException e) {
        throw new RuntimeException(String.format("Box API returned the error code %d\n\n%s", e.getResponseCode(), e.getResponse()), e);
    }
}
Also used : BoxAPIException(com.box.sdk.BoxAPIException) BoxCollaboration(com.box.sdk.BoxCollaboration)

Example 3 with BoxCollaboration

use of com.box.sdk.BoxCollaboration in project camel by apache.

the class BoxCollaborationsManager method deleteCollaboration.

/**
     * Delete collaboration.
     * 
     * @param collaborationId
     *            - the id of comment to change.
     * @return The comment with changed message.
     */
public void deleteCollaboration(String collaborationId) {
    try {
        LOG.debug("Deleting collaboration(id=" + collaborationId + ")");
        if (collaborationId == null) {
            throw new IllegalArgumentException("Parameter 'collaborationId' can not be null");
        }
        BoxCollaboration collaboration = new BoxCollaboration(boxConnection, collaborationId);
        collaboration.delete();
    } catch (BoxAPIException e) {
        throw new RuntimeException(String.format("Box API returned the error code %d\n\n%s", e.getResponseCode(), e.getResponse()), e);
    }
}
Also used : BoxAPIException(com.box.sdk.BoxAPIException) BoxCollaboration(com.box.sdk.BoxCollaboration)

Aggregations

BoxAPIException (com.box.sdk.BoxAPIException)3 BoxCollaboration (com.box.sdk.BoxCollaboration)3