public class BoxFilesManager extends BoxItemsManager
| Constructor and Description |
|---|
BoxFilesManager(IBoxConfig config,
IBoxResourceHub resourceHub,
IBoxJSONParser parser,
IBoxRequestAuth auth,
IBoxRESTClient restClient)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
BoxFile |
copyFile(String fileId,
BoxFileRequestObject requestObject)
Copy a file.
|
BoxFile |
createSharedLink(String fileId,
BoxFileRequestObject requestObject)
Create a shared link for a file, given the id of the file/folder.
|
void |
deleteFile(String fileId,
BoxFileRequestObject requestObject)
Delete a file.
|
void |
deleteTrashFile(String id,
BoxFileRequestObject requestObject)
Permanently delete a trashed file.
|
InputStream |
downloadFile(String fileId,
BoxDefaultRequestObject requestObject)
Execute the download and return the raw InputStream.
|
void |
downloadFile(String fileId,
File destination,
IFileTransferListener listener,
BoxDefaultRequestObject requestObject)
Download a file.
|
void |
downloadFile(String fileId,
OutputStream[] outputStreams,
IFileTransferListener listener,
BoxDefaultRequestObject requestObject)
Download a file.
|
InputStream |
downloadThumbnail(String fileId,
String extension,
BoxImageRequestObject requestObject)
Get thumbnail of a file.
|
BoxFile |
getFile(String fileId,
BoxDefaultRequestObject requestObject)
Get file given a file id.
|
BoxCollection |
getFileComments(String fileId,
BoxDefaultRequestObject requestObject)
Get comments on a file.
|
static List<BoxFile> |
getFiles(BoxCollection collection)
Get files in a collection.
|
static List<BoxFileVersion> |
getFileVersions(BoxCollection collection)
Get file versions in a collection.
|
List<BoxFileVersion> |
getFileVersions(String fileId,
BoxDefaultRequestObject requestObject)
Get file versions(Note: Versions are only tracked for Box users with premium accounts.).
|
BoxPreview |
getPreview(String fileId,
String extension,
BoxImageRequestObject requestObject)
Get preview of a file.
|
BoxFile |
getTrashFile(String fileId,
BoxDefaultRequestObject requestObject)
Get trashed file given a file id.
|
BoxFile |
restoreTrashFile(String id,
BoxItemRestoreRequestObject requestObject)
Restore a trashed file.
|
BoxFile |
updateFileInfo(String fileId,
BoxFileRequestObject requestObject)
Update info for a file.
|
BoxFile |
uploadFile(BoxFileUploadRequestObject requestObject)
Upload file/files.
|
BoxFile |
uploadNewVersion(String fileId,
BoxFileUploadRequestObject requestObject)
Upload a new version of a file.
|
copyItem, createSharedLink, deleteTrashItem, getItem, getTrashItem, restoreTrashItem, updateItemInfoexecuteRequestWithNoResponseBody, getAuth, getClassFromType, getConfig, getJSONParser, getResourceHub, getResponseAndParse, getResponseAndParseAndTryCast, getRestClient, tryCastBoxItem, tryCastObjectpublic BoxFilesManager(IBoxConfig config, IBoxResourceHub resourceHub, IBoxJSONParser parser, IBoxRequestAuth auth, IBoxRESTClient restClient)
config - BoxConfigresourceHub - resource hubparser - json parserauth - auth for api callsrestClient - REST client to make api calls.public BoxFile getFile(String fileId, BoxDefaultRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
fileId - id of the filerequestObject - object that goes into request.BoxRestException - exceptionBoxServerException - exceptionAuthFatalFailureException - exception indicating authentication totally failedpublic BoxFile getTrashFile(String fileId, BoxDefaultRequestObject requestObject) throws BoxRestException, AuthFatalFailureException, BoxServerException
fileId - id of the filerequestObject - object that goes into request.BoxRestException - exceptionBoxServerException - exceptionAuthFatalFailureException - exception indicating authentication totally failedpublic void deleteFile(String fileId, BoxFileRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
fileId - id of the filerequestObject - object that goes into request.BoxRestException - exceptionBoxServerException - exceptionAuthFatalFailureException - exception indicating authentication totally failedpublic void deleteTrashFile(String id, BoxFileRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
id - id of the filerequestObject - request objectBoxRestExceptionAuthFatalFailureExceptionBoxServerExceptionpublic BoxFile restoreTrashFile(String id, BoxItemRestoreRequestObject requestObject) throws BoxRestException, AuthFatalFailureException, BoxServerException
id - id of the trashed file.requestObject - BoxRestExceptionAuthFatalFailureExceptionBoxServerExceptionpublic BoxPreview getPreview(String fileId, String extension, BoxImageRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
fileId - id of the fileextension - requested of the preview image file extensionrequestObject - request objectBoxRestException - exceptionBoxServerException - exceptionAuthFatalFailureException - exception indicating authenticating totally failedpublic InputStream downloadThumbnail(String fileId, String extension, BoxImageRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
fileId - id of the fileextension - file extension of requested thumbnailrequestObject - request objectBoxRestException - exceptionBoxServerException - exceptionAuthFatalFailureException - exception indicating authenticating totally failedpublic BoxFile uploadFile(BoxFileUploadRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException, InterruptedException
requestObject - reqeust objectBoxRestException - exceptionBoxServerException - exceptionAuthFatalFailureException - exception indicating authentication totally failedInterruptedExceptionpublic BoxFile copyFile(String fileId, BoxFileRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
fileId - id of the filerequestObject - request objectBoxRestException - exceptionBoxServerException - exceptionAuthFatalFailureException - exceptionpublic void downloadFile(String fileId, File destination, IFileTransferListener listener, BoxDefaultRequestObject requestObject) throws BoxRestException, BoxServerException, IllegalStateException, IOException, InterruptedException, AuthFatalFailureException
fileId - id of the filedestination - destination of the downloaded filelistener - listener to monitor the download progressrequestObject - extra request object going into api requestBoxRestException - exceptionBoxServerException - exceptionIllegalStateException - exceptionIOException - exceptionInterruptedException - exceptionAuthFatalFailureException - exception indicating authenticating totally failedpublic InputStream downloadFile(String fileId, BoxDefaultRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
fileId - id of the file to be downloadedrequestObject - request objectBoxRestException - exceptionBoxServerException - exceptionAuthFatalFailureException - exception indicating authenticating totally failedpublic void downloadFile(String fileId, OutputStream[] outputStreams, IFileTransferListener listener, BoxDefaultRequestObject requestObject) throws BoxRestException, IOException, BoxServerException, InterruptedException, AuthFatalFailureException
fileId - id of the fileoutputStreams - OutputStream's the file will be downloaded intolistener - listener to monitor the download progressrequestObject - request objectBoxRestException - exceptionBoxServerException - exceptionIOException - exceptionInterruptedException - exceptionAuthFatalFailureException - exception indicating authenticating totally failedpublic BoxFile uploadNewVersion(String fileId, BoxFileUploadRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException, InterruptedException
fileId - id of the fileBoxFileUploadRequestObject - requestObjectBoxRestException - exceptionBoxServerException - exceptionAuthFatalFailureException - exceptionInterruptedExceptionpublic List<BoxFileVersion> getFileVersions(String fileId, BoxDefaultRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
fileId - id of the filerequestObject - request objectBoxRestException - exceptionBoxServerException - exceptionAuthFatalFailureException - exception indicating authentication totally failedpublic BoxFile updateFileInfo(String fileId, BoxFileRequestObject requestObject) throws UnsupportedEncodingException, BoxRestException, BoxServerException, AuthFatalFailureException
fileId - id of the filerequestObject - request objectUnsupportedEncodingException - exceptionBoxRestException - exceptionBoxServerException - exceptionAuthFatalFailureException - exception indicating authentication totally failedpublic BoxFile createSharedLink(String fileId, BoxFileRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
fileId - id of the filerequestObject - request objectBoxRestException - exceptionBoxServerException - exceptionAuthFatalFailureException - exception indicating authentication totally failedpublic BoxCollection getFileComments(String fileId, BoxDefaultRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
fileId - id of the filerequestObject - object that goes into request.BoxRestException - exceptionBoxServerException - exceptionAuthFatalFailureException - exception indicating authentication totally failedpublic static List<BoxFile> getFiles(BoxCollection collection)
collection - collectionpublic static List<BoxFileVersion> getFileVersions(BoxCollection collection)
collection - collectionCopyright © 2014. All Rights Reserved.