public class BoxApiFile extends BoxApi
mBaseUploadUri, mBaseUri, mSession| Constructor and Description |
|---|
BoxApiFile(BoxSession session)
Constructs a BoxApiFile with the provided BoxSession
|
| Modifier and Type | Method and Description |
|---|---|
BoxRequestsFile.AddCommentToFile |
getAddCommentRequest(java.lang.String fileId,
java.lang.String message)
Gets a request that adds a comment to a file
|
BoxRequestsFile.AddTaggedCommentToFile |
getAddTaggedCommentRequest(java.lang.String fileId,
java.lang.String taggedMessage)
Gets a request for adding a comment with tags that mention users.
|
BoxRequestsFile.AddFileToCollection |
getAddToCollectionRequest(java.lang.String fileId,
java.lang.String collectionId)
Gets a request that adds a file to a collection
|
BoxRequestsFile.GetFileComments |
getCommentsRequest(java.lang.String id)
Gets a request that retrieves the comments on a file
|
protected java.lang.String |
getCommentUrl()
Gets the URL for posting a comment on a file
|
BoxRequestsFile.CopyFile |
getCopyRequest(java.lang.String id,
java.lang.String parentId)
Gets a request that copies a file
|
BoxRequestsFile.UpdatedSharedFile |
getCreateSharedLinkRequest(java.lang.String id)
Gets a request that creates a shared link for a file
|
protected java.lang.String |
getDeleteFileVersionUrl(java.lang.String id,
java.lang.String versionId)
Gets the URL for deleting the version of a file
|
BoxRequestsFile.DeleteFileFromCollection |
getDeleteFromCollectionRequest(java.lang.String id)
Gets a request that removes a file from a collection
|
BoxRequestsFile.DeleteFile |
getDeleteRequest(java.lang.String id)
Gets a request that deletes a folder
|
BoxRequestsFile.DeleteTrashedFile |
getDeleteTrashedFileRequest(java.lang.String id)
Gets a request that permanently deletes a file from the trash
|
BoxRequestsFile.DeleteFileVersion |
getDeleteVersionRequest(java.lang.String id,
java.lang.String versionId)
Gets a request that deletes a version of a file
|
BoxRequestsFile.UpdateFile |
getDisableSharedLinkRequest(java.lang.String id)
Gets a request that disables a shared link for a folder
|
BoxRequestsFile.DownloadFile |
getDownloadRequest(java.io.File target,
java.lang.String fileId)
Gets a request that downloads a given file to a target file
|
BoxRequestsFile.DownloadFile |
getDownloadRequest(java.io.OutputStream outputStream,
java.lang.String fileId)
Gets a request that downloads the given file to the provided outputStream.
|
BoxRequestsFile.DownloadThumbnail |
getDownloadThumbnailRequest(java.io.File target,
java.lang.String fileId)
Gets a request that downloads a thumbnail to a target file
|
BoxRequestsFile.DownloadThumbnail |
getDownloadThumbnailRequest(java.io.OutputStream outputStream,
java.lang.String fileId)
Gets a request that downloads the given file thumbnail to the provided outputStream.
|
BoxRequestsFile.DownloadFile |
getDownloadUrlRequest(java.io.File target,
java.lang.String url)
Gets a request that downloads a given asset from the url to a target file
This is used to download miscellaneous url assets for instance from the representations endpoint.
|
BoxRequestsFile.GetEmbedLinkFileInfo |
getEmbedLinkRequest(java.lang.String id)
Gets a request that retrieves an expiring embedded link which can be embedded in a webview for a preview.
|
protected java.lang.String |
getFileCommentsUrl(java.lang.String id)
Gets the URL for comments on a file
|
protected java.lang.String |
getFileCopyUrl(java.lang.String id)
Gets the URL for copying a file
|
protected java.lang.String |
getFileDownloadUrl(java.lang.String id)
Gets the URL for downloading a file
|
protected java.lang.String |
getFileInfoUrl(java.lang.String id)
Gets the URL for file information
|
protected java.lang.String |
getFilesUrl()
Gets the URL for files
|
protected java.lang.String |
getFileUploadNewVersionUrl(java.lang.String id)
Gets the URL for uploading a new version of a file
|
protected java.lang.String |
getFileUploadUrl()
Gets the URL for uploading a file
|
protected java.lang.String |
getFileVersionsUrl(java.lang.String id)
Gets the URL for versions of a file
|
BoxRequestsFile.GetFileInfo |
getInfoRequest(java.lang.String id)
Gets a request that retrieves information on a file
|
BoxRequestsFile.UpdateFile |
getMoveRequest(java.lang.String id,
java.lang.String parentId)
Gets a request that moves a file to another folder
|
protected java.lang.String |
getPromoteFileVersionUrl(java.lang.String id)
Gets the URL for promoting the version of a file
|
BoxRequestsFile.PromoteFileVersion |
getPromoteVersionRequest(java.lang.String id,
java.lang.String versionId)
Gets a request that promotes a version to the top of the version stack for a file.
|
BoxRequestsFile.UpdateFile |
getRenameRequest(java.lang.String id,
java.lang.String newName)
Gets a request that renames a file
|
BoxRequestsFile.RestoreTrashedFile |
getRestoreTrashedFileRequest(java.lang.String id)
Gets a request that restores a trashed file
|
protected java.lang.String |
getThumbnailFileDownloadUrl(java.lang.String id)
Gets the URL for downloading the thumbnail of a file
|
BoxRequestsFile.GetTrashedFile |
getTrashedFileRequest(java.lang.String id)
Gets a request that returns a file in the trash
|
protected java.lang.String |
getTrashedFileUrl(java.lang.String id)
Gets the URL for comments on a file
|
BoxRequestsFile.UpdateFile |
getUpdateRequest(java.lang.String id)
Gets a request that updates a file's information
|
BoxRequestsFile.UploadNewVersion |
getUploadNewVersionRequest(java.io.File file,
java.lang.String destinationFileId)
Gets a request that uploads a new file version from an existing file
|
BoxRequestsFile.UploadNewVersion |
getUploadNewVersionRequest(java.io.InputStream fileInputStream,
java.lang.String destinationFileId)
Gets a request that uploads a new file version from an input stream
|
BoxRequestsFile.UploadFile |
getUploadRequest(java.io.File file,
java.lang.String destinationFolderId)
Gets a request that uploads a file from an existing file
|
BoxRequestsFile.UploadFile |
getUploadRequest(java.io.InputStream fileInputStream,
java.lang.String fileName,
java.lang.String destinationFolderId)
Gets a request that uploads a file from an input stream
|
BoxRequestsFile.GetFileVersions |
getVersionsRequest(java.lang.String id)
Gets a request that retrieves the versions of a file
|
getBaseUploadUri, getBaseUripublic BoxApiFile(BoxSession session)
session - authenticated session to use with the BoxApiFileprotected java.lang.String getFilesUrl()
protected java.lang.String getFileInfoUrl(java.lang.String id)
id - id of the fileprotected java.lang.String getFileCopyUrl(java.lang.String id)
id - id of the fileprotected java.lang.String getFileUploadUrl()
protected java.lang.String getFileUploadNewVersionUrl(java.lang.String id)
id - id of the fileprotected java.lang.String getTrashedFileUrl(java.lang.String id)
id - id of the fileprotected java.lang.String getFileCommentsUrl(java.lang.String id)
id - id of the fileprotected java.lang.String getFileVersionsUrl(java.lang.String id)
id - id of the fileprotected java.lang.String getPromoteFileVersionUrl(java.lang.String id)
id - id of the fileprotected java.lang.String getDeleteFileVersionUrl(java.lang.String id,
java.lang.String versionId)
id - id of the fileversionId - versionId of the file to deleteprotected java.lang.String getFileDownloadUrl(java.lang.String id)
id - id of the fileprotected java.lang.String getThumbnailFileDownloadUrl(java.lang.String id)
id - id of the fileprotected java.lang.String getCommentUrl()
public BoxRequestsFile.GetFileInfo getInfoRequest(java.lang.String id)
id - id of file to retrieve info onpublic BoxRequestsFile.GetEmbedLinkFileInfo getEmbedLinkRequest(java.lang.String id)
id - id of file to retrieve info onpublic BoxRequestsFile.UpdateFile getUpdateRequest(java.lang.String id)
id - id of file to update information onpublic BoxRequestsFile.CopyFile getCopyRequest(java.lang.String id, java.lang.String parentId)
id - id of the file to copyparentId - id of the parent folder to copy the file intopublic BoxRequestsFile.UpdateFile getRenameRequest(java.lang.String id, java.lang.String newName)
id - id of file to renamenewName - id of file to retrieve info onpublic BoxRequestsFile.UpdateFile getMoveRequest(java.lang.String id, java.lang.String parentId)
id - id of file to moveparentId - id of parent folder to move file intopublic BoxRequestsFile.DeleteFile getDeleteRequest(java.lang.String id)
id - id of folder to deletepublic BoxRequestsFile.UpdatedSharedFile getCreateSharedLinkRequest(java.lang.String id)
id - id of file to create shared link forpublic BoxRequestsFile.UpdateFile getDisableSharedLinkRequest(java.lang.String id)
id - id of folder to disable a shared link forpublic BoxRequestsFile.AddCommentToFile getAddCommentRequest(java.lang.String fileId, java.lang.String message)
fileId - id of the file to add the comment tomessage - message for the comment that will be addedpublic BoxRequestsFile.AddTaggedCommentToFile getAddTaggedCommentRequest(java.lang.String fileId, java.lang.String taggedMessage)
fileId - id of the file to add the comment totaggedMessage - message for the comment that will be addedpublic BoxRequestsFile.UploadFile getUploadRequest(java.io.InputStream fileInputStream, java.lang.String fileName, java.lang.String destinationFolderId)
fileInputStream - input stream of the filefileName - name of the new filedestinationFolderId - id of the parent folder for the new filepublic BoxRequestsFile.UploadFile getUploadRequest(java.io.File file, java.lang.String destinationFolderId)
file - file to uploaddestinationFolderId - id of the parent folder for the new filepublic BoxRequestsFile.UploadNewVersion getUploadNewVersionRequest(java.io.InputStream fileInputStream, java.lang.String destinationFileId)
fileInputStream - input stream of the new file versiondestinationFileId - id of the file to upload a new version ofpublic BoxRequestsFile.UploadNewVersion getUploadNewVersionRequest(java.io.File file, java.lang.String destinationFileId)
file - file to upload as a new versiondestinationFileId - id of the file to upload a new version ofpublic BoxRequestsFile.DownloadFile getDownloadRequest(java.io.File target, java.lang.String fileId) throws java.io.IOException
target - target file to download to, target can be either a directory or a filefileId - id of the file to downloadjava.io.IOException - throws FileNotFoundException if target file does not exist.public BoxRequestsFile.DownloadFile getDownloadUrlRequest(java.io.File target, java.lang.String url) throws java.io.IOException
target - target file to download to, target can be either a directory or a fileurl - url of the asset to downloadjava.io.IOException - throws FileNotFoundException if target file does not exist.public BoxRequestsFile.DownloadFile getDownloadRequest(java.io.OutputStream outputStream, java.lang.String fileId)
outputStream - outputStream to write file contents to.fileId - the file id to download.public BoxRequestsFile.DownloadThumbnail getDownloadThumbnailRequest(java.io.File target, java.lang.String fileId) throws java.io.IOException
target - target file to download to, target can be either a directory or a filefileId - id of file to download the thumbnail ofjava.io.IOException - throws FileNotFoundException if target file does not exist.public BoxRequestsFile.DownloadThumbnail getDownloadThumbnailRequest(java.io.OutputStream outputStream, java.lang.String fileId)
outputStream - outputStream to write file contents to.fileId - the file id to download.public BoxRequestsFile.GetTrashedFile getTrashedFileRequest(java.lang.String id)
id - id of file to get in the trashpublic BoxRequestsFile.DeleteTrashedFile getDeleteTrashedFileRequest(java.lang.String id)
id - id of file to delete from the trashpublic BoxRequestsFile.RestoreTrashedFile getRestoreTrashedFileRequest(java.lang.String id)
id - id of file to restorepublic BoxRequestsFile.GetFileComments getCommentsRequest(java.lang.String id)
id - id of the file to retrieve comments forpublic BoxRequestsFile.GetFileVersions getVersionsRequest(java.lang.String id)
id - id of the file to retrieve file versions forpublic BoxRequestsFile.PromoteFileVersion getPromoteVersionRequest(java.lang.String id, java.lang.String versionId)
id - id of the file to promote the version ofversionId - id of the file version to promote to the toppublic BoxRequestsFile.DeleteFileVersion getDeleteVersionRequest(java.lang.String id, java.lang.String versionId)
id - id of the file to delete a version ofversionId - id of the file version to deletepublic BoxRequestsFile.AddFileToCollection getAddToCollectionRequest(java.lang.String fileId, java.lang.String collectionId)
fileId - id of file to add to collectioncollectionId - id of collection to add the file topublic BoxRequestsFile.DeleteFileFromCollection getDeleteFromCollectionRequest(java.lang.String id)
id - id of file to delete from the collection