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.AbortUploadSession |
getAbortUploadSessionRequest(BoxUploadSession uploadSession)
Get a request to abort the upload session
|
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.GetCollaborations |
getCollaborationsRequest(java.lang.String id)
Gets a request that gets the collaborations of a file
|
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.CommitUploadSession |
getCommitSessionRequest(java.util.List<BoxUploadSessionPart> uploadedParts,
BoxUploadSession uploadSession)
Commit an upload session after all parts have been uploaded, creating the new file or the version
|
BoxRequestsFile.CommitUploadSession |
getCommitSessionRequest(java.util.List<BoxUploadSessionPart> uploadedParts,
java.util.Map<java.lang.String,java.lang.String> attributes,
java.lang.String ifMatch,
java.lang.String ifNoneMatch,
BoxUploadSession uploadSession)
Commit an upload session after all parts have been uploaded, creating the new file or the version
|
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
|
BoxRequestsFile.CreateUploadSession |
getCreateUploadSessionRequest(java.io.File file,
java.lang.String folderId)
Gets a request that creates an upload session for uploading a new file
|
BoxRequestsFile.CreateUploadSession |
getCreateUploadSessionRequest(java.io.InputStream is,
java.lang.String fileName,
long fileSize,
java.lang.String folderId)
Gets a request that creates an upload session for uploading a new file
|
BoxRequestsFile.CreateNewVersionUploadSession |
getCreateUploadVersionSessionRequest(java.io.File file,
java.lang.String fileId)
Gets a request that creates an upload session for uploading a new file version
|
BoxRequestsFile.CreateNewVersionUploadSession |
getCreateUploadVersionSessionRequest(java.io.InputStream is,
java.lang.String fileName,
long fileSize,
java.lang.String fileId)
Gets a request that creates an upload session for uploading a new file version
|
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.DownloadRepresentation |
getDownloadRepresentationRequest(java.lang.String id,
java.io.File targetFile,
BoxRepresentation representation)
Gets a request to download a representation object for a given file representation
|
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 |
getFileCollaborationsUrl(java.lang.String id)
Gets the URL for the file collaborations
|
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
|
BoxRequestsFile.FilePreviewed |
getFilePreviewedRequest(java.lang.String fileId)
Gets a request that inform the server that a file was previewed.
|
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.ListUploadSessionParts |
getListUploadSessionRequest(BoxUploadSession uploadSession)
Gets a request that retrieves all the parts uploaded for some specific session
|
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 |
getPreviewFileUrl()
Get the URL to inform that a file was previewed
|
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.GetUploadSession |
getUploadSession(java.lang.String uploadSessionId)
Gets a request to fetch the upload session using the upload session id.
|
protected java.lang.String |
getUploadSessionForNewFileUrl()
Get the URL for uploading a new file using a chunked session.
|
protected java.lang.String |
getUploadSessionForNewFileVersionUrl(java.lang.String id)
Get the URL for uploading file a new version of a file in chunks
|
protected java.lang.String |
getUploadSessionInfoUrl(java.lang.String sessionId)
Gets the URL for the upload session
|
BoxRequestsFile.UploadSessionPart |
getUploadSessionPartRequest(java.io.File file,
BoxUploadSession uploadSession,
int partNumber)
Get a request for uploading a part to a BoxUploadSession
|
BoxRequestsFile.UploadSessionPart |
getUploadSessionPartRequest(java.io.InputStream is,
long fileSize,
BoxUploadSession uploadSession,
int partNumber)
Get a request for uploading a part to a BoxUploadSession
|
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 getFileCollaborationsUrl(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()
protected java.lang.String getPreviewFileUrl()
protected java.lang.String getUploadSessionForNewFileUrl()
protected java.lang.String getUploadSessionForNewFileVersionUrl(java.lang.String id)
id - id of file to retrieve info onpublic 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 only be 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.DownloadRepresentation getDownloadRepresentationRequest(java.lang.String id, java.io.File targetFile, BoxRepresentation representation)
id - id of the file to get the representation fromtargetFile - file to store the thumbnailrepresentation - the representation to be downloadedpublic 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.GetCollaborations getCollaborationsRequest(java.lang.String id)
id - id of file to request collaborations ofpublic 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 collectionpublic BoxRequestsFile.FilePreviewed getFilePreviewedRequest(java.lang.String fileId)
fileId - public BoxRequestsFile.CreateUploadSession getCreateUploadSessionRequest(java.io.File file, java.lang.String folderId) throws java.io.FileNotFoundException
file - The file to be uploadedfolderId - Folder Idjava.io.FileNotFoundExceptionpublic BoxRequestsFile.CreateUploadSession getCreateUploadSessionRequest(java.io.InputStream is, java.lang.String fileName, long fileSize, java.lang.String folderId)
is - InputStream for the file to be uplaodedfileName - the file name for the file to be created/uploadedfileSize - the inputStream size (or the origin file size)folderId - the folder ID where this file will be uploadedpublic BoxRequestsFile.CreateNewVersionUploadSession getCreateUploadVersionSessionRequest(java.io.File file, java.lang.String fileId) throws java.io.FileNotFoundException
file - The file to be uploadedfileId - The fileIdjava.io.FileNotFoundExceptionpublic BoxRequestsFile.CreateNewVersionUploadSession getCreateUploadVersionSessionRequest(java.io.InputStream is, java.lang.String fileName, long fileSize, java.lang.String fileId) throws java.io.FileNotFoundException
is - the inputStream from where the file data will be readfileName - the fileName to create on serverfileSize - the file size (also the inputStream size)fileId - the existing fileId to receive the new versionjava.io.FileNotFoundExceptionpublic BoxRequestsFile.UploadSessionPart getUploadSessionPartRequest(java.io.File file, BoxUploadSession uploadSession, int partNumber) throws java.io.IOException
file - the file that is used to read the chunk using the ranges for the partnumberuploadSession - the BoxUploadSessionpartNumber - The part number being uploadedjava.io.IOExceptionpublic BoxRequestsFile.UploadSessionPart getUploadSessionPartRequest(java.io.InputStream is, long fileSize, BoxUploadSession uploadSession, int partNumber) throws java.io.IOException
is - File InputStream to get readfileSize - File sizeuploadSession - the multipart upload session (BoxUploadSession)partNumber - The part number being uploadedjava.io.IOExceptionpublic BoxRequestsFile.CommitUploadSession getCommitSessionRequest(java.util.List<BoxUploadSessionPart> uploadedParts, java.util.Map<java.lang.String,java.lang.String> attributes, java.lang.String ifMatch, java.lang.String ifNoneMatch, BoxUploadSession uploadSession)
uploadedParts - the list of uploaded parts to be committed.attributes - the key value pairs of attributes from the file instance.ifMatch - ensures that your app only alters files/folders on Box if you have the current version.ifNoneMatch - ensure that it retrieve unnecessary data if the most current version of file is on-hand.uploadSession - the BoxUploadSessionpublic BoxRequestsFile.CommitUploadSession getCommitSessionRequest(java.util.List<BoxUploadSessionPart> uploadedParts, BoxUploadSession uploadSession)
uploadedParts - the list of uploaded parts to be committed.uploadSession - the BoxUploadSessionprotected java.lang.String getUploadSessionInfoUrl(java.lang.String sessionId)
sessionId - The upload session id which this part belongs to.
Upload session id can be created to initiate a chunked file upload by calling the create upload session API.public BoxRequestsFile.GetUploadSession getUploadSession(java.lang.String uploadSessionId)
public BoxRequestsFile.ListUploadSessionParts getListUploadSessionRequest(BoxUploadSession uploadSession)
public BoxRequestsFile.AbortUploadSession getAbortUploadSessionRequest(BoxUploadSession uploadSession)
uploadSession -