public class BoxItemsManager extends BoxResourceManager
Constructor and Description |
---|
BoxItemsManager(IBoxConfig config,
IBoxResourceHub resourceHub,
IBoxJSONParser parser,
IBoxRequestAuth auth,
IBoxRESTClient restClient)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
BoxItem |
copyItem(java.lang.String id,
BoxItemRequestObject requestObject,
BoxResourceType type)
Copy an item.
|
BoxItem |
createSharedLink(java.lang.String id,
BoxItemRequestObject requestObject,
BoxResourceType type)
Create a shared link for an item, given the id .
|
void |
deleteTrashItem(java.lang.String id,
BoxResourceType type,
BoxFileRequestObject requestObject)
Permanently delete a trashed item.
|
BoxItem |
getItem(java.lang.String id,
BoxDefaultRequestObject requestObject,
BoxResourceType type)
Get item given an item id.
|
BoxItem |
getTrashItem(java.lang.String itemId,
BoxResourceType type,
BoxDefaultRequestObject requestObject)
Get a trashed item.
|
BoxItem |
restoreTrashItem(java.lang.String id,
BoxResourceType type,
BoxItemRestoreRequestObject requestObject)
Restore a trashed item.
|
BoxItem |
updateItemInfo(java.lang.String id,
BoxItemRequestObject requestObject,
BoxResourceType type)
Update info for an item
|
executeRequestWithNoResponseBody, getAuth, getConfig, getJSONParser, getResourceHub, getResponseAndParse, getResponseAndParseAndTryCast, tryCastBoxItem, tryCastObject
public BoxItemsManager(IBoxConfig config, IBoxResourceHub resourceHub, IBoxJSONParser parser, IBoxRequestAuth auth, IBoxRESTClient restClient)
config
- BoxConfigresourceHub
- IResourceHubparser
- json parserauth
- auth for api callsrestClient
- REST client to make api calls.public BoxItem getItem(java.lang.String id, BoxDefaultRequestObject requestObject, BoxResourceType type) throws BoxRestException, BoxServerException, AuthFatalFailureException
id
- id of the itemBoxBasicRequestObject
- requestObjecttype
- resource typeBoxRestException
- exceptionBoxServerException
- exceptionAuthFatalFailureException
- exception indicating authentication totally failedpublic BoxItem getTrashItem(java.lang.String itemId, BoxResourceType type, BoxDefaultRequestObject requestObject) throws BoxRestException, AuthFatalFailureException, BoxServerException
itemId
- item idtype
- typerequestObject
- request objectBoxRestException
- exceptionAuthFatalFailureException
- exceptionBoxServerException
- exceptionpublic BoxItem copyItem(java.lang.String id, BoxItemRequestObject requestObject, BoxResourceType type) throws BoxRestException, BoxServerException, AuthFatalFailureException
id
- id of the itemrequestObject
- request objecttype
- resource type of the itemBoxRestException
- exceptionBoxServerException
- exceptionAuthFatalFailureException
- exceptionpublic BoxItem updateItemInfo(java.lang.String id, BoxItemRequestObject requestObject, BoxResourceType type) throws java.io.UnsupportedEncodingException, BoxRestException, BoxServerException, AuthFatalFailureException
id
- id of the itemrequestObject
- request objecttype
- resource type of the itemjava.io.UnsupportedEncodingException
- exceptionBoxRestException
- exceptionBoxServerException
- exceptionAuthFatalFailureException
- exception indicating authentication totally failedpublic BoxItem createSharedLink(java.lang.String id, BoxItemRequestObject requestObject, BoxResourceType type) throws BoxRestException, BoxServerException, AuthFatalFailureException
auth
- authorizationid
- id of the itemrequestObject
- request objecttype
- resource type of this itemBoxRestException
- exceptionBoxServerException
- exceptionAuthFatalFailureException
- exception indicating authentication totally failedpublic void deleteTrashItem(java.lang.String id, BoxResourceType type, BoxFileRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
id
- id of the itemtype
- resource type of the item.requestObject
- request objectBoxRestException
AuthFatalFailureException
BoxServerException
public BoxItem restoreTrashItem(java.lang.String id, BoxResourceType type, BoxItemRestoreRequestObject requestObject) throws BoxRestException, AuthFatalFailureException, BoxServerException
id
- id of the trashed item.type
- type of the itemrequestObject
- BoxRestException
AuthFatalFailureException
BoxServerException