public class BoxFilesManagerImpl extends BoxItemsManagerImpl implements IBoxFilesManager
| Constructor and Description |
|---|
BoxFilesManagerImpl(IBoxConfig config,
IBoxResourceHub resourceHub,
IBoxJSONParser parser,
IBoxRequestAuth auth,
IBoxRESTClient restClient)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
BoxFile |
copyFile(String fileId,
BoxItemCopyRequestObject requestObject)
Copy a file.
|
BoxFile |
createSharedLink(String fileId,
BoxSharedLinkRequestObject requestObject)
Create a shared link for a file, given the id of the file/folder.
|
void |
deleteFile(String fileId,
BoxDefaultRequestObject requestObject)
Delete a 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)
Deprecated.
|
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)
Deprecated.
|
static List<BoxFileVersion> |
getFileVersions(BoxCollection collection)
Deprecated.
|
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.
|
BoxThumbnail |
getThumbnail(String fileId,
String extension,
BoxImageRequestObject requestObject)
Get thumbnail of a 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, getItem, updateItemInfoexecuteRequestWithNoResponseBody, getAuth, getClassFromType, getConfig, getJSONParser, getResourceHub, getResponseAndParse, getResponseAndParseAndTryCast, getRestClient, tryCastBoxItem, tryCastObjectpublic BoxFilesManagerImpl(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
IBoxFilesManagergetFile in interface IBoxFilesManagerfileId - id of the filerequestObject - object that goes into request.BoxRestException - See BoxRestException for more info.BoxServerException - See com.box.restclientv2.exceptions.BoxServerException for more info.AuthFatalFailureException - See com.box.restclientv2.exceptions.AuthFatalFailureException for more info.public void deleteFile(String fileId, BoxDefaultRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
IBoxFilesManagerdeleteFile in interface IBoxFilesManagerfileId - id of the filerequestObject - object that goes into request.BoxRestException - See BoxRestException for more info.BoxServerException - See com.box.restclientv2.exceptions.BoxServerException for more info.AuthFatalFailureException - See com.box.restclientv2.exceptions.AuthFatalFailureException for more info.public BoxPreview getPreview(String fileId, String extension, BoxImageRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
IBoxFilesManagergetPreview in interface IBoxFilesManagerfileId - id of the fileextension - requested of the preview image file extensionrequestObject - request objectBoxRestException - See BoxRestException for more info.BoxServerException - See com.box.restclientv2.exceptions.BoxServerException for more info.AuthFatalFailureException - See com.box.restclientv2.exceptions.AuthFatalFailureException for more info.public BoxThumbnail getThumbnail(String fileId, String extension, BoxImageRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
IBoxFilesManagergetThumbnail in interface IBoxFilesManagerfileId - id of the fileextension - file extension of requested thumbnailrequestObject - request objectBoxRestException - See BoxRestException for more info.BoxServerException - See com.box.restclientv2.exceptions.BoxServerException for more info.AuthFatalFailureException - See com.box.restclientv2.exceptions.AuthFatalFailureException for more info.@Deprecated public InputStream downloadThumbnail(String fileId, String extension, BoxImageRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
IBoxFilesManagerdownloadThumbnail in interface IBoxFilesManagerBoxRestExceptionBoxServerExceptionAuthFatalFailureExceptionpublic BoxFile uploadFile(BoxFileUploadRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException, InterruptedException
IBoxFilesManageruploadFile in interface IBoxFilesManagerrequestObject - reqeust objectBoxRestException - See BoxRestException for more info.BoxServerException - See com.box.restclientv2.exceptions.BoxServerException for more info.AuthFatalFailureException - See com.box.restclientv2.exceptions.AuthFatalFailureException for more info.InterruptedExceptionpublic BoxFile copyFile(String fileId, BoxItemCopyRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
IBoxFilesManagercopyFile in interface IBoxFilesManagerfileId - id of the filerequestObject - request objectBoxRestException - See BoxRestException for more info.BoxServerException - See com.box.restclientv2.exceptions.BoxServerException for more info.AuthFatalFailureException - See com.box.restclientv2.exceptions.AuthFatalFailureException for more info.public void downloadFile(String fileId, File destination, IFileTransferListener listener, BoxDefaultRequestObject requestObject) throws BoxRestException, BoxServerException, IllegalStateException, IOException, InterruptedException, AuthFatalFailureException
IBoxFilesManagerdownloadFile in interface IBoxFilesManagerfileId - id of the filedestination - destination of the downloaded filelistener - listener to monitor the download progressrequestObject - extra request object going into api requestBoxRestException - See BoxRestException for more info.BoxServerException - See com.box.restclientv2.exceptions.BoxServerException for more info.IllegalStateException - IllegalStateExceptionIOException - IOExceptionInterruptedException - InterruptedExceptionAuthFatalFailureException - See com.box.restclientv2.exceptions.AuthFatalFailureException for more info.public InputStream downloadFile(String fileId, BoxDefaultRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
IBoxFilesManagerdownloadFile in interface IBoxFilesManagerfileId - id of the file to be downloadedrequestObject - request objectBoxRestException - See BoxRestException for more info.BoxServerException - See com.box.restclientv2.exceptions.BoxServerException for more info.AuthFatalFailureException - See com.box.restclientv2.exceptions.AuthFatalFailureException for more info.public void downloadFile(String fileId, OutputStream[] outputStreams, IFileTransferListener listener, BoxDefaultRequestObject requestObject) throws BoxRestException, IOException, BoxServerException, InterruptedException, AuthFatalFailureException
IBoxFilesManagerdownloadFile in interface IBoxFilesManagerfileId - id of the fileoutputStreams - OutputStream's the file will be downloaded intolistener - listener to monitor the download progressrequestObject - request objectBoxRestException - See BoxRestException for more info.IOException - exceptionBoxServerException - See com.box.restclientv2.exceptions.BoxServerException for more info.InterruptedException - exceptionAuthFatalFailureException - See com.box.restclientv2.exceptions.AuthFatalFailureException for more info.public BoxFile uploadNewVersion(String fileId, BoxFileUploadRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException, InterruptedException
IBoxFilesManageruploadNewVersion in interface IBoxFilesManagerfileId - id of the filerequestObject - requestObjectBoxRestException - See BoxRestException for more info.BoxServerException - See com.box.restclientv2.exceptions.BoxServerException for more info.AuthFatalFailureException - See com.box.restclientv2.exceptions.AuthFatalFailureException for more info.InterruptedExceptionpublic List<BoxFileVersion> getFileVersions(String fileId, BoxDefaultRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
IBoxFilesManagergetFileVersions in interface IBoxFilesManagerfileId - id of the filerequestObject - request objectBoxRestException - See BoxRestException for more info.BoxServerException - See com.box.restclientv2.exceptions.BoxServerException for more info.AuthFatalFailureException - See com.box.restclientv2.exceptions.AuthFatalFailureException for more info.public BoxFile updateFileInfo(String fileId, BoxFileRequestObject requestObject) throws UnsupportedEncodingException, BoxRestException, BoxServerException, AuthFatalFailureException
IBoxFilesManagerupdateFileInfo in interface IBoxFilesManagerfileId - id of the filerequestObject - request objectUnsupportedEncodingException - exceptionBoxRestException - See BoxRestException for more info.BoxServerException - See com.box.restclientv2.exceptions.BoxServerException for more info.AuthFatalFailureException - See com.box.restclientv2.exceptions.AuthFatalFailureException for more info.public BoxFile createSharedLink(String fileId, BoxSharedLinkRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
IBoxFilesManagercreateSharedLink in interface IBoxFilesManagerfileId - id of the filerequestObject - request objectBoxRestException - See BoxRestException for more info.BoxServerException - See com.box.restclientv2.exceptions.BoxServerException for more info.AuthFatalFailureException - See com.box.restclientv2.exceptions.AuthFatalFailureException for more info.public BoxCollection getFileComments(String fileId, BoxDefaultRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
IBoxFilesManagergetFileComments in interface IBoxFilesManagerfileId - id of the filerequestObject - object that goes into request.BoxRestException - See BoxRestException for more info.BoxServerException - See com.box.restclientv2.exceptions.BoxServerException for more info.AuthFatalFailureException - See com.box.restclientv2.exceptions.AuthFatalFailureException for more info.@Deprecated public static List<BoxFile> getFiles(BoxCollection collection)
collection - collection@Deprecated public static List<BoxFileVersion> getFileVersions(BoxCollection collection)
collection - collectionCopyright © 2014. All Rights Reserved.