@BoxResourceType(value="file") public class BoxFile extends BoxItem
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 |
BoxFile.Info
Contains information about a BoxFile.
|
static class |
BoxFile.Permission
Enumerates the possible permissions that a user can have on a file.
|
static class |
BoxFile.ThumbnailFileType
Used to specify what filetype to request for a file thumbnail.
|
Modifier and Type | Field and Description |
---|---|
static URLTemplate |
ABORT_UPLOAD_SESSION_URL_TEMPLATE
Abort Upload Session URL Template.
|
static URLTemplate |
ADD_COLLABORATION_URL
Add Collaborations URL Template.
|
static URLTemplate |
ADD_COMMENT_URL_TEMPLATE
Add Comment URL Template.
|
static URLTemplate |
ADD_TASK_URL_TEMPLATE
Add Task URL Template.
|
static String[] |
ALL_FIELDS
An array of all possible file fields that can be requested when calling
getInfo(String...) . |
static String[] |
ALL_VERSION_FIELDS
An array of all possible version fields that can be requested when calling
getVersions(String...) . |
static URLTemplate |
CONTENT_URL_TEMPLATE
Content URL Template.
|
static URLTemplate |
COPY_URL_TEMPLATE
Copy URL Template.
|
static URLTemplate |
FILE_URL_TEMPLATE
File URL Template.
|
static URLTemplate |
GET_ALL_FILE_COLLABORATIONS_URL
Get All File Collaborations URL Template.
|
static URLTemplate |
GET_COMMENTS_URL_TEMPLATE
Get Comments URL Template.
|
static URLTemplate |
GET_TASKS_URL_TEMPLATE
Get Tasks URL Template.
|
static URLTemplate |
GET_THUMBNAIL_JPG_TEMPLATE
Get Thumbnail JPG Template.
|
static URLTemplate |
GET_THUMBNAIL_PNG_TEMPLATE
Get Thumbnail PNG Template.
|
static URLTemplate |
METADATA_URL_TEMPLATE
Metadata URL Template.
|
static URLTemplate |
UPLOAD_SESSION_STATUS_URL_TEMPLATE
Upload Session Status URL Template.
|
static URLTemplate |
UPLOAD_SESSION_URL_TEMPLATE
Upload Session URL Template.
|
static URLTemplate |
VERSIONS_URL_TEMPLATE
Versions URL Template.
|
SHARED_ITEM_URL_TEMPLATE, WATERMARK_URL_TEMPLATE
Constructor and Description |
---|
BoxFile(BoxAPIConnection api,
String id)
Constructs a BoxFile for a file with a given ID.
|
Modifier and Type | Method and Description |
---|---|
String |
addClassification(String classificationType)
Adds a metadata classification to the specified file.
|
BoxComment.Info |
addComment(String message)
Adds a comment to this file.
|
BoxTask.Info |
addTask(BoxTask.Action action,
String message,
Date dueAt)
Adds a new task to this file.
|
BoxTask.Info |
addTask(BoxTask.Action action,
String message,
Date dueAt,
BoxTask.CompletionRule completionRule)
Adds a new task to this file.
|
BoxWebHook.Info |
addWebHook(URL address,
BoxWebHook.Trigger... triggers)
Adds new
BoxWebHook to this BoxFile . |
BoxWatermark |
applyWatermark()
Used to apply or update the watermark for the file.
|
boolean |
canUploadVersion(String name)
Checks if a new version of the file can be uploaded with the specified name.
|
boolean |
canUploadVersion(String name,
long fileSize)
Checks if a new version of the file can be uploaded with the specified name and size.
|
BoxCollaboration.Info |
collaborate(BoxCollaborator collaborator,
BoxCollaboration.Role role,
Boolean notify,
Boolean canViewPath)
Adds a collaborator to this file.
|
BoxCollaboration.Info |
collaborate(BoxCollaborator collaborator,
BoxCollaboration.Role role,
Boolean notify,
Boolean canViewPath,
Date expiresAt,
Boolean isAccessOnly)
Adds a collaborator to this file.
|
BoxCollaboration.Info |
collaborate(String email,
BoxCollaboration.Role role,
Boolean notify,
Boolean canViewPath)
Adds a collaborator to this folder.
|
BoxCollaboration.Info |
collaborate(String email,
BoxCollaboration.Role role,
Boolean notify,
Boolean canViewPath,
Date expiresAt,
Boolean isAccessOnly)
Adds a collaborator to this folder.
|
BoxFile.Info |
copy(BoxFolder destination)
Copies this item to another folder.
|
BoxFile.Info |
copy(BoxFolder destination,
String newName)
Copies this item to another folder and gives it a new name.
|
Metadata |
createMetadata(Metadata metadata)
Creates metadata on this file in the global properties template.
|
Metadata |
createMetadata(String typeName,
Metadata metadata)
Creates metadata on this file in the specified template type.
|
Metadata |
createMetadata(String typeName,
String scope,
Metadata metadata)
Creates metadata on this file in the specified template type.
|
BoxSharedLink |
createSharedLink(BoxSharedLinkRequest sharedLinkRequest)
Creates a shared link.
|
BoxFileUploadSession.Info |
createUploadSession(long fileSize)
Creates an upload session to create a new version of a file in chunks.
|
void |
delete()
Deletes this file by moving it to the trash.
|
void |
deleteClassification()
Deletes the classification on the file.
|
void |
deleteMetadata()
Deletes the file properties metadata.
|
void |
deleteMetadata(String typeName)
Deletes the file metadata of specified template type.
|
void |
deleteMetadata(String typeName,
String scope)
Deletes the file metadata of specified template type.
|
void |
download(OutputStream output)
Downloads the contents of this file to a given OutputStream.
|
void |
download(OutputStream output,
ProgressListener listener)
Downloads the contents of this file to a given OutputStream while reporting the progress to a ProgressListener.
|
void |
downloadRange(OutputStream output,
long offset)
Downloads a part of this file's contents, starting at specified byte offset.
|
void |
downloadRange(OutputStream output,
long rangeStart,
long rangeEnd)
Downloads a part of this file's contents, starting at rangeStart and stopping at rangeEnd.
|
void |
downloadRange(OutputStream output,
long rangeStart,
long rangeEnd,
ProgressListener listener)
Downloads a part of this file's contents, starting at rangeStart and stopping at rangeEnd, while reporting the
progress to a ProgressListener.
|
BoxResourceIterable<BoxCollaboration.Info> |
getAllFileCollaborations(String... fields)
Used to retrieve all collaborations associated with the item.
|
Iterable<Metadata> |
getAllMetadata(String... fields)
Used to retrieve all metadata associated with the file.
|
String |
getClassification()
Gets the classification type for the specified file.
|
List<BoxComment.Info> |
getComments()
Gets a list of any comments on this file.
|
protected URL |
getDownloadUrl()
Can be used to override the URL used for file download.
|
URL |
getDownloadURL()
Gets an expiring URL for downloading a file directly from Box.
|
BoxFile.Info |
getInfo(String... fields)
Gets information about this item that's limited to a list of specified fields.
|
BoxFile.Info |
getInfoWithRepresentations(String representationHints,
String... fields)
Gets information about this item including a specified set of representations.
|
protected URL |
getItemURL() |
Metadata |
getMetadata()
Gets the file properties metadata.
|
Metadata |
getMetadata(String typeName)
Gets the file metadata of specified template type.
|
Metadata |
getMetadata(String typeName,
String scope)
Gets the file metadata of specified template type.
|
URL |
getPreviewLink()
Gets an expiring URL for creating an embedded preview session.
|
void |
getRepresentationContent(String representationHint,
OutputStream output)
Fetches the contents of a file representation and writes them to the provided output stream.
|
void |
getRepresentationContent(String representationHint,
String assetPath,
OutputStream output)
Fetches the contents of a file representation with asset path and writes them to the provided output stream.
|
void |
getRepresentationContent(String representationHint,
String assetPath,
OutputStream output,
int maxRetries)
Fetches the contents of a file representation with asset path and writes them to the provided output stream.
|
List<BoxTask.Info> |
getTasks(String... fields)
Gets a list of any tasks on this file with requested fields.
|
Collection<BoxFileVersion> |
getVersions(String... fields)
Gets up to 1000 versions of this file.
|
PartialCollection<BoxFileVersion> |
getVersionsRange(long offset,
long limit,
String... fields)
Retrieves a specific range of versions of this file.
|
BoxWatermark |
getWatermark(String... fields)
Used to retrieve the watermark for the file.
|
BoxLock |
lock()
Locks a file.
|
BoxLock |
lock(boolean isDownloadPrevented)
Locks a file.
|
BoxLock |
lock(Date expiresAt)
Locks a file.
|
BoxLock |
lock(Date expiresAt,
boolean isDownloadPrevented)
Locks a file.
|
BoxItem.Info |
move(BoxFolder destination)
Moves this item to another folder.
|
BoxItem.Info |
move(BoxFolder destination,
String newName)
Moves this item to another folder and gives it a new name.
|
void |
removeWatermark()
Removes a watermark from the file.
|
void |
rename(String newName)
Renames this file.
|
String |
setClassification(String classificationType)
Attempts to add classification to a file.
|
BoxFile.Info |
setCollections(BoxCollection... collections)
Sets the collections that this item belongs to.
|
Metadata |
setMetadata(String templateName,
String scope,
Metadata metadata)
Sets the provided metadata on the file.
|
void |
unlock()
Unlocks a file.
|
String |
updateClassification(String classificationType)
Updates a metadata classification on the specified file.
|
void |
updateInfo(BoxFile.Info info)
Updates the information about this file with any info fields that have been modified locally.
|
Metadata |
updateMetadata(Metadata metadata)
Updates the file metadata.
|
BoxFile.Info |
uploadLargeFile(InputStream inputStream,
long fileSize)
Creates a new version of a file.
|
BoxFile.Info |
uploadLargeFile(InputStream inputStream,
long fileSize,
int nParallelConnections,
long timeOut,
TimeUnit unit)
Creates a new version of a file using specified number of parallel http connections.
|
BoxFile.Info |
uploadLargeFile(InputStream inputStream,
long fileSize,
int nParallelConnections,
long timeOut,
TimeUnit unit,
Map<String,String> fileAttributes)
Creates a new version of a file using specified number of parallel http connections.
|
BoxFile.Info |
uploadLargeFile(InputStream inputStream,
long fileSize,
Map<String,String> fileAttributes)
Creates a new version of a file.
|
BoxFile.Info |
uploadNewVersion(InputStream fileContent)
Uploads a new version of this file, replacing the current version.
|
BoxFile.Info |
uploadNewVersion(InputStream fileContent,
Date modified,
long fileSize,
ProgressListener listener)
Uploads a new version of this file, replacing the current version, while reporting the progress to a
ProgressListener.
|
BoxFile.Info |
uploadNewVersion(InputStream fileContent,
String fileContentSHA1)
Uploads a new version of this file, replacing the current version.
|
BoxFile.Info |
uploadNewVersion(InputStream fileContent,
String fileContentSHA1,
Date modified)
Uploads a new version of this file, replacing the current version.
|
BoxFile.Info |
uploadNewVersion(InputStream fileContent,
String fileContentSHA1,
Date modified,
long fileSize,
ProgressListener listener)
Uploads a new version of this file, replacing the current version, while reporting the progress to a
ProgressListener.
|
BoxFile.Info |
uploadNewVersion(InputStream fileContent,
String fileContentSHA1,
Date modified,
String name)
Uploads a new version of this file, replacing the current version.
|
BoxFile.Info |
uploadNewVersion(InputStream fileContent,
String fileContentSHA1,
Date modified,
String name,
long fileSize,
ProgressListener listener)
Uploads a new version of this file, replacing the current version, while reporting the progress to a
ProgressListener.
|
applyWatermark, getSharedItem, getSharedItem, getWatermark, removeWatermark
equals, getAPI, getID, getResourceType, hashCode
public static final String[] ALL_FIELDS
getInfo(String...)
.public static final String[] ALL_VERSION_FIELDS
getVersions(String...)
.public static final URLTemplate FILE_URL_TEMPLATE
public static final URLTemplate CONTENT_URL_TEMPLATE
public static final URLTemplate VERSIONS_URL_TEMPLATE
public static final URLTemplate COPY_URL_TEMPLATE
public static final URLTemplate ADD_COMMENT_URL_TEMPLATE
public static final URLTemplate GET_COMMENTS_URL_TEMPLATE
public static final URLTemplate METADATA_URL_TEMPLATE
public static final URLTemplate ADD_TASK_URL_TEMPLATE
public static final URLTemplate GET_TASKS_URL_TEMPLATE
public static final URLTemplate GET_THUMBNAIL_PNG_TEMPLATE
public static final URLTemplate GET_THUMBNAIL_JPG_TEMPLATE
public static final URLTemplate UPLOAD_SESSION_URL_TEMPLATE
public static final URLTemplate UPLOAD_SESSION_STATUS_URL_TEMPLATE
public static final URLTemplate ABORT_UPLOAD_SESSION_URL_TEMPLATE
public static final URLTemplate ADD_COLLABORATION_URL
public static final URLTemplate GET_ALL_FILE_COLLABORATIONS_URL
public BoxFile(BoxAPIConnection api, String id)
api
- the API connection to be used by the file.id
- the ID of the file.protected URL getItemURL()
getItemURL
in class BoxItem
public BoxSharedLink createSharedLink(BoxSharedLinkRequest sharedLinkRequest)
sharedLinkRequest
- Shared link to createpublic BoxWebHook.Info addWebHook(URL address, BoxWebHook.Trigger... triggers)
BoxWebHook
to this BoxFile
.address
- BoxWebHook.Info.getAddress()
triggers
- BoxWebHook.Info.getTriggers()
BoxWebHook.Info
public BoxComment.Info addComment(String message)
message
- the comment's message.public BoxTask.Info addTask(BoxTask.Action action, String message, Date dueAt)
action
- the action the task assignee will be prompted to do.message
- an optional message to include with the task.dueAt
- the day at which this task is due.public BoxTask.Info addTask(BoxTask.Action action, String message, Date dueAt, BoxTask.CompletionRule completionRule)
action
- the action the task assignee will be prompted to do.message
- an optional message to include with the task.dueAt
- the day at which this task is due.completionRule
- the rule for completing the task.public URL getDownloadURL()
public void download(OutputStream output)
output
- the stream to where the file will be written.public void download(OutputStream output, ProgressListener listener)
output
- the stream to where the file will be written.listener
- a listener for monitoring the download's progress.public void downloadRange(OutputStream output, long offset)
output
- the stream to where the file will be written.offset
- the byte offset at which to start the download.public void downloadRange(OutputStream output, long rangeStart, long rangeEnd)
output
- the stream to where the file will be written.rangeStart
- the byte offset at which to start the download.rangeEnd
- the byte offset at which to stop the download.public void downloadRange(OutputStream output, long rangeStart, long rangeEnd, ProgressListener listener)
output
- the stream to where the file will be written.rangeStart
- the byte offset at which to start the download.rangeEnd
- the byte offset at which to stop the download.listener
- a listener for monitoring the download's progress.protected URL getDownloadUrl()
public BoxFile.Info copy(BoxFolder destination)
BoxItem
public BoxFile.Info copy(BoxFolder destination, String newName)
BoxItem
public void delete()
public BoxItem.Info move(BoxFolder destination)
BoxItem
public BoxItem.Info move(BoxFolder destination, String newName)
BoxItem
public void rename(String newName)
newName
- the new name of the file.public BoxFile.Info getInfo(String... fields)
BoxItem
public BoxFile.Info getInfoWithRepresentations(String representationHints, String... fields)
representationHints
- hints for representations to be retrievedfields
- the fields to retrieve.public void getRepresentationContent(String representationHint, OutputStream output)
representationHint
- the X-Rep-Hints query for the representation to fetch.output
- the output stream to write the contents to.public void getRepresentationContent(String representationHint, String assetPath, OutputStream output)
representationHint
- the X-Rep-Hints query for the representation to fetch.assetPath
- the path of the asset for representations containing multiple files.output
- the output stream to write the contents to.public void getRepresentationContent(String representationHint, String assetPath, OutputStream output, int maxRetries)
representationHint
- the X-Rep-Hints query for the representation to fetch.assetPath
- the path of the asset for representations containing multiple files.output
- the output stream to write the contents to.maxRetries
- the maximum number of attempts to call the request for retrieving status information
indicating whether the representation has been generated and is ready to fetch.
If the number of attempts is exceeded, the method will throw a BoxApiException.public void updateInfo(BoxFile.Info info)
The only fields that will be updated are the ones that have been modified locally. For example, the following code won't update any information (or even send a network request) since none of the info's fields were changed:
BoxFile file = new File(api, id); BoxFile.Info info = file.getInfo(); file.updateInfo(info);
info
- the updated info.public Collection<BoxFileVersion> getVersions(String... fields)
new BoxFile(api, file_id).getVersions() // will return all default fields
new BoxFile(api, file_id).getVersions("name") // will return only specified fields
fields
- the fields to retrieve. If nothing provided default fields will be returned.
You can find list of available fields at ALL_VERSION_FIELDS
public PartialCollection<BoxFileVersion> getVersionsRange(long offset, long limit, String... fields)
offset
- the index of the first version of this file to retrieve.limit
- the maximum number of versions to retrieve after the offset.fields
- the fields to retrieve.public boolean canUploadVersion(String name)
name
- the new name for the file.public boolean canUploadVersion(String name, long fileSize)
name
- the new name for the file.fileSize
- the size of the new version content in bytes.public BoxFile.Info uploadNewVersion(InputStream fileContent)
fileContent
- a stream containing the new file contents.public BoxFile.Info uploadNewVersion(InputStream fileContent, String fileContentSHA1)
fileContent
- a stream containing the new file contents.fileContentSHA1
- a string containing the SHA1 hash of the new file contents.public BoxFile.Info uploadNewVersion(InputStream fileContent, String fileContentSHA1, Date modified)
fileContent
- a stream containing the new file contents.fileContentSHA1
- a string containing the SHA1 hash of the new file contents.modified
- the date that the new version was modified.public BoxFile.Info uploadNewVersion(InputStream fileContent, String fileContentSHA1, Date modified, String name)
fileContent
- a stream containing the new file contents.fileContentSHA1
- a string containing the SHA1 hash of the new file contents.modified
- the date that the new version was modified.name
- the new name for the filepublic BoxFile.Info uploadNewVersion(InputStream fileContent, Date modified, long fileSize, ProgressListener listener)
fileContent
- a stream containing the new file contents.modified
- the date that the new version was modified.fileSize
- the size of the file used for determining the progress of the upload.listener
- a listener for monitoring the upload's progress.public BoxFile.Info uploadNewVersion(InputStream fileContent, String fileContentSHA1, Date modified, long fileSize, ProgressListener listener)
fileContent
- a stream containing the new file contents.fileContentSHA1
- the SHA1 hash of the file contents. will be sent along in the Content-MD5 headermodified
- the date that the new version was modified.fileSize
- the size of the file used for determining the progress of the upload.listener
- a listener for monitoring the upload's progress.public BoxFile.Info uploadNewVersion(InputStream fileContent, String fileContentSHA1, Date modified, String name, long fileSize, ProgressListener listener)
fileContent
- a stream containing the new file contents.fileContentSHA1
- the SHA1 hash of the file contents. will be sent along in the Content-MD5 headermodified
- the date that the new version was modified.name
- the new name for the filefileSize
- the size of the file used for determining the progress of the upload.listener
- a listener for monitoring the upload's progress.public URL getPreviewLink()
public List<BoxComment.Info> getComments()
public List<BoxTask.Info> getTasks(String... fields)
fields
- optional fields to retrieve for this task.public Metadata createMetadata(Metadata metadata)
metadata
- The new metadata values.public Metadata createMetadata(String typeName, Metadata metadata)
typeName
- the metadata template type name.metadata
- the new metadata values.public Metadata createMetadata(String typeName, String scope, Metadata metadata)
typeName
- the metadata template type name.scope
- the metadata scope (global or enterprise).metadata
- the new metadata values.public Metadata setMetadata(String templateName, String scope, Metadata metadata)
templateName
- the name of the metadata template.scope
- the scope of the template (usually "global" or "enterprise").metadata
- the new metadata values.public String addClassification(String classificationType)
classificationType
- the metadata classification type.public String updateClassification(String classificationType)
classificationType
- the metadata classification type.public String setClassification(String classificationType)
classificationType
- the metadata classification type.public String getClassification()
public void deleteClassification()
public BoxLock lock(boolean isDownloadPrevented)
isDownloadPrevented
- is downloading of file prevented when locked.public BoxLock lock(Date expiresAt)
expiresAt
- expiration date of the lock.public BoxLock lock(Date expiresAt, boolean isDownloadPrevented)
expiresAt
- expiration date of the lock.isDownloadPrevented
- is downloading of file prevented when locked.public void unlock()
public Iterable<Metadata> getAllMetadata(String... fields)
fields
- the optional fields to retrieve.public Metadata getMetadata()
public Metadata getMetadata(String typeName)
typeName
- the metadata template type name.public Metadata getMetadata(String typeName, String scope)
typeName
- the metadata template type name.scope
- the metadata scope (global or enterprise).public Metadata updateMetadata(Metadata metadata)
metadata
- the new metadata values.public void deleteMetadata()
public void deleteMetadata(String typeName)
typeName
- the metadata template type name.public void deleteMetadata(String typeName, String scope)
typeName
- the metadata template type name.scope
- the metadata scope (global or enterprise).public BoxWatermark getWatermark(String... fields)
fields
- the fields to retrieve.public BoxWatermark applyWatermark()
public void removeWatermark()
public BoxFile.Info setCollections(BoxCollection... collections)
setCollections
in class BoxItem
collections
- the collections that this item should belong to.public BoxFileUploadSession.Info createUploadSession(long fileSize)
fileSize
- the size of the file that will be uploaded.public BoxFile.Info uploadLargeFile(InputStream inputStream, long fileSize) throws InterruptedException, IOException
inputStream
- the stream instance that contains the data.fileSize
- the size of the file that will be uploaded.InterruptedException
- when a thread execution is interrupted.IOException
- when reading a stream throws exception.public BoxFile.Info uploadLargeFile(InputStream inputStream, long fileSize, Map<String,String> fileAttributes) throws InterruptedException, IOException
inputStream
- the stream instance that contains the data.fileSize
- the size of the file that will be uploaded.fileAttributes
- file attributes to setInterruptedException
- when a thread execution is interrupted.IOException
- when reading a stream throws exception.public BoxFile.Info uploadLargeFile(InputStream inputStream, long fileSize, int nParallelConnections, long timeOut, TimeUnit unit) throws InterruptedException, IOException
inputStream
- the stream instance that contains the data.fileSize
- the size of the file that will be uploaded.nParallelConnections
- number of parallel http connections to usetimeOut
- time to wait before killing the jobunit
- time unit for the time wait valueInterruptedException
- when a thread execution is interrupted.IOException
- when reading a stream throws exception.public BoxFile.Info uploadLargeFile(InputStream inputStream, long fileSize, int nParallelConnections, long timeOut, TimeUnit unit, Map<String,String> fileAttributes) throws InterruptedException, IOException
inputStream
- the stream instance that contains the data.fileSize
- the size of the file that will be uploaded.nParallelConnections
- number of parallel http connections to usetimeOut
- time to wait before killing the jobunit
- time unit for the time wait valuefileAttributes
- file attributes to setInterruptedException
- when a thread execution is interrupted.IOException
- when reading a stream throws exception.public BoxCollaboration.Info collaborate(BoxCollaborator collaborator, BoxCollaboration.Role role, Boolean notify, Boolean canViewPath, Date expiresAt, Boolean isAccessOnly)
collaborator
- the collaborator to add.role
- the role of the collaborator.notify
- determines if the user (or all the users in the group) will receive email notifications.canViewPath
- whether view path collaboration feature is enabled or not.expiresAt
- when the collaboration should expire.isAccessOnly
- whether the collaboration is access only or not.public BoxCollaboration.Info collaborate(BoxCollaborator collaborator, BoxCollaboration.Role role, Boolean notify, Boolean canViewPath)
collaborator
- the collaborator to add.role
- the role of the collaborator.notify
- determines if the user (or all the users in the group) will receive email notifications.canViewPath
- whether view path collaboration feature is enabled or not.public BoxCollaboration.Info collaborate(String email, BoxCollaboration.Role role, Boolean notify, Boolean canViewPath, Date expiresAt, Boolean isAccessOnly)
email
- the email address of the collaborator to add.role
- the role of the collaborator.notify
- determines if the user (or all the users in the group) will receive email notifications.canViewPath
- whether view path collaboration feature is enabled or not.expiresAt
- when the collaboration should expire.isAccessOnly
- whether the collaboration is access only or not.public BoxCollaboration.Info collaborate(String email, BoxCollaboration.Role role, Boolean notify, Boolean canViewPath)
email
- the email address of the collaborator to add.role
- the role of the collaborator.notify
- determines if the user (or all the users in the group) will receive email notifications.canViewPath
- whether view path collaboration feature is enabled or not.public BoxResourceIterable<BoxCollaboration.Info> getAllFileCollaborations(String... fields)
fields
- the optional fields to retrieve.