@BoxResourceType(value="collaboration") public class BoxCollaboration extends BoxResource
Unless otherwise noted, the methods in this class can throw an unchecked BoxAPIException
(unchecked
meaning that the compiler won't force you to handle it) if an error occurs. If you wish to implement custom error
handling for errors related to the Box REST API, you should capture this exception explicitly.
Modifier and Type | Class and Description |
---|---|
class |
BoxCollaboration.Info
Contains information about a BoxCollaboration.
|
static class |
BoxCollaboration.Role
Enumerates the possible access levels that a collaborator can have.
|
static class |
BoxCollaboration.Status
Enumerates the possible statuses that a collaboration can have.
|
Modifier and Type | Field and Description |
---|---|
static String[] |
ALL_FIELDS
All possible fields on a collaboration object.
|
static URLTemplate |
COLLABORATION_URL_TEMPLATE
Collaboration URL Template.
|
static URLTemplate |
COLLABORATIONS_URL_TEMPLATE
Collaborations URL Template.
|
static URLTemplate |
GET_ALL_FILE_COLLABORATIONS_URL
Get All File Collaboations URL.
|
static URLTemplate |
PENDING_COLLABORATIONS_URL
Pending Collaborations URL.
|
Constructor and Description |
---|
BoxCollaboration(BoxAPIConnection api,
String id)
Constructs a BoxCollaboration for a collaboration with a given ID.
|
Modifier and Type | Method and Description |
---|---|
protected static BoxCollaboration.Info |
create(BoxAPIConnection api,
JsonObject accessibleBy,
JsonObject item,
BoxCollaboration.Role role,
Boolean notify,
Boolean canViewPath)
Create a new collaboration object.
|
protected static BoxCollaboration.Info |
create(BoxAPIConnection api,
JsonObject accessibleBy,
JsonObject item,
BoxCollaboration.Role role,
Boolean notify,
Boolean canViewPath,
Date expiresAt)
Create a new collaboration object.
|
protected static BoxCollaboration.Info |
create(BoxAPIConnection api,
JsonObject accessibleBy,
JsonObject item,
BoxCollaboration.Role role,
Boolean notify,
Boolean canViewPath,
Date expiresAt,
Boolean isAccessOnly)
Create a new collaboration object.
|
void |
delete()
Deletes this collaboration.
|
static BoxResourceIterable<BoxCollaboration.Info> |
getAllFileCollaborations(BoxAPIConnection api,
String fileID,
int pageSize,
String... fields)
Used to retrieve all collaborations associated with the item.
|
BoxCollaboration.Info |
getInfo(String... fields)
Gets information about this collection with a custom set of fields.
|
static Collection<BoxCollaboration.Info> |
getPendingCollaborations(BoxAPIConnection api,
String... fields)
Gets all pending collaboration invites for the current user.
|
void |
updateInfo(BoxCollaboration.Info info)
Updates the information about this collaboration with any info fields that have been modified locally.
|
equals, getAPI, getID, getResourceType, hashCode
public static final String[] ALL_FIELDS
public static final URLTemplate COLLABORATIONS_URL_TEMPLATE
public static final URLTemplate PENDING_COLLABORATIONS_URL
public static final URLTemplate COLLABORATION_URL_TEMPLATE
public static final URLTemplate GET_ALL_FILE_COLLABORATIONS_URL
public BoxCollaboration(BoxAPIConnection api, String id)
api
- the API connection to be used by the collaboration.id
- the ID of the collaboration.protected static BoxCollaboration.Info create(BoxAPIConnection api, JsonObject accessibleBy, JsonObject item, BoxCollaboration.Role role, Boolean notify, Boolean canViewPath)
api
- the API connection used to make the request.accessibleBy
- the JSON object describing who should be collaborated.item
- the JSON object describing which item to collaborate.role
- the role to give the collaborators.notify
- the user/group should receive email notification of the collaboration or not.canViewPath
- the view path collaboration feature is enabled or not.protected static BoxCollaboration.Info create(BoxAPIConnection api, JsonObject accessibleBy, JsonObject item, BoxCollaboration.Role role, Boolean notify, Boolean canViewPath, Date expiresAt)
api
- the API connection used to make the request.accessibleBy
- the JSON object describing who should be collaborated.item
- the JSON object describing which item to collaborate.role
- the role to give the collaborators.notify
- the user/group should receive email notification of the collaboration or not.canViewPath
- the view path collaboration feature is enabled or not.expiresAt
- the date the collaboration expiresprotected static BoxCollaboration.Info create(BoxAPIConnection api, JsonObject accessibleBy, JsonObject item, BoxCollaboration.Role role, Boolean notify, Boolean canViewPath, Date expiresAt, Boolean isAccessOnly)
api
- the API connection used to make the request.accessibleBy
- the JSON object describing who should be collaborated.item
- the JSON object describing which item to collaborate.role
- the role to give the collaborators.notify
- the user/group should receive email notification of the collaboration or not.canViewPath
- the view path collaboration feature is enabled or not.expiresAt
- the date the collaboration expiresisAccessOnly
- the collaboration is an access only collaboration or not.public static Collection<BoxCollaboration.Info> getPendingCollaborations(BoxAPIConnection api, String... fields)
api
- the API connection to use.public static BoxResourceIterable<BoxCollaboration.Info> getAllFileCollaborations(BoxAPIConnection api, String fileID, int pageSize, String... fields)
api
- BoxAPIConnection from the associated file.fileID
- FileID of the associated filepageSize
- page size for server pages of the Iterablefields
- the optional fields to retrieve.public BoxCollaboration.Info getInfo(String... fields)
fields
- the fields to retrieve.public void updateInfo(BoxCollaboration.Info info)
info
- the updated info.public void delete()