use of com.box.sdk.BoxAPIException in project camel by apache.
the class BoxTasksManager method getTaskAssignmentInfo.
/**
* Get task assignment information.
*
* @param taskAssignmentId
* - the id of task assignment.
* @return The task assignment information.
*/
public BoxTaskAssignment.Info getTaskAssignmentInfo(String taskAssignmentId) {
try {
LOG.debug("Getting info for task(id=" + taskAssignmentId + ")");
if (taskAssignmentId == null) {
throw new IllegalArgumentException("Parameter 'taskAssignmentId' can not be null");
}
BoxTaskAssignment taskAssignment = new BoxTaskAssignment(boxConnection, taskAssignmentId);
return taskAssignment.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 BoxCollaborationsManager method getFolderCollaborations.
/**
* Get information about all of the collaborations for folder.
*
* @param folderId
* - the id of folder to get collaborations information on.
*
* @return The collection of collaboration information for folder.
*/
public Collection<BoxCollaboration.Info> getFolderCollaborations(String folderId) {
try {
LOG.debug("Getting collaborations for folder(id=" + folderId + ")");
if (folderId == null) {
throw new IllegalArgumentException("Parameter 'folderId' can not be null");
}
BoxFolder folder = new BoxFolder(boxConnection, folderId);
return folder.getCollaborations();
} 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 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);
}
}
use of com.box.sdk.BoxAPIException in project camel by apache.
the class BoxUsersManagerIntegrationTest method testDeleteUserEmailAlias.
@Ignore
@Test
public void testDeleteUserEmailAlias() throws Exception {
EmailAlias emailAlias = null;
try {
emailAlias = testUser.addEmailAlias(CAMEL_TEST_USER_EMAIL_ALIAS);
} catch (BoxAPIException e) {
throw new RuntimeException(String.format("Box API returned the error code %d\n\n%s", e.getResponseCode(), e.getResponse()), e);
}
final Map<String, Object> headers = new HashMap<String, Object>();
// parameter type is String
headers.put("CamelBox.userId", testUser.getID());
// parameter type is String
headers.put("CamelBox.emailAliasId", emailAlias.getID());
requestBodyAndHeaders("direct://DELETEUSEREMAILALIAS", null, headers);
assertNotNull("deleteUserEmailAlias email aliases", testUser.getEmailAliases());
assertEquals("deleteUserEmailAlias email aliases", 0, testUser.getEmailAliases().size());
}
use of com.box.sdk.BoxAPIException 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);
}
}
Aggregations