Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
106 lines (78 loc) · 3.9 KB

File metadata and controls

106 lines (78 loc) · 3.9 KB
Copy raw file
Download raw file
Outline
Edit and raw actions

Collaborations

Collaborations are used to share folders between users or groups. They also define what permissions a user has for a folder.

Add a Collaboration

A collaboration can be added for an existing user or group with collaborate(BoxCollaborator, BoxCollaboration.Role). The role parameter determines what permissions the collaborator will have on the folder.

BoxCollaborator user = new BoxUser(api, "user-id")
BoxFolder folder = new BoxFile(api, "folder-id");
folder.collaborate(user, BoxCollaboration.Role.EDITOR);

You can also add a collaboration by providing an email address with collaborate(String, BoxCollaboration.Role). If the receipient doesn't have a Box account, they will be asked create one.

BoxFolder folder = new BoxFile(api, "id");
folder.collaborate("gcurtis@box.com", BoxCollaboration.Role.EDITOR);

Edit a Collaboration

A collaboration can be edited by creating a new BoxCollaboration.Info object or updating an existing one, and then calling updateInfo(BoxCollaboration.Info)

BoxCollaboration collaboration = new BoxCollaboration(api, "id");
BoxCollaboration.Info info = collaboration.new Info();
info.setStatus(BoxCollaboration.Status.ACCEPTED);
collaboration.updateInfo(info);

Remove a Collaboration

A collaboration can be removed by calling delete().

BoxCollaboration collaboration = new BoxCollaboration(api, "id");
collaboration.delete();

Get a Collaboration's Information

Calling getInfo() on a collaboration returns a snapshot of the collaboration's info.

BoxCollaboration collaboration = new BoxCollaboration(api, "id");
BoxCollaboration.Info info = collaboration.getInfo();

Get the Collaborations on a Folder

You can get all of the collaborations on a folder by calling getCollaborations() on the folder.

BoxFolder folder = new BoxFile(api, "id");
Collection<BoxCollaboration.Info> collaborations = folder.getCollaborations();

Get Pending Collaborations

A collection of all the user's pending collaborations can be retrieved with getPendingCollaborations(BoxAPIConnection).

Collection<BoxCollaboration.Info> pendingCollaborations =
    BoxCollaboration.getPendingCollaborations(api);
Morty Proxy This is a proxified and sanitized view of the page, visit original site.