public class BoxFoldersManager extends BoxItemsManager
Constructor and Description |
---|
BoxFoldersManager(IBoxConfig config,
IBoxResourceHub resourceHub,
IBoxJSONParser parser,
IBoxRequestAuth auth,
IBoxRESTClient restClient)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
BoxFolder |
copyFolder(java.lang.String folderId,
BoxFolderRequestObject requestObject)
Copy a folder.
|
BoxFolder |
createFolder(BoxFolderRequestObject requestObject)
Create a folder.
|
BoxFolder |
createSharedLink(java.lang.String folderId,
BoxFolderRequestObject requestObject)
Create a shared link for a folder, given the id of the file/folder.
|
void |
deleteFolder(java.lang.String folderId,
BoxFolderRequestObject requestObject)
Delete a folder.
|
void |
deleteTrashFolder(java.lang.String id,
BoxFileRequestObject requestObject)
Permanently delete a trashed folder.
|
BoxFolder |
getFolder(java.lang.String folderId,
BoxDefaultRequestObject requestObject)
Get folder given a folder id.
|
java.util.List<BoxCollaboration> |
getFolderCollaborations(java.lang.String folderId,
BoxDefaultRequestObject requestObject)
Get collaborations of a folder.
|
BoxCollection |
getFolderItems(java.lang.String folderId,
BoxFolderRequestObject requestObject)
Get the items(subfolders, files, weblinks...) under a folder.
|
static java.util.List<BoxFolder> |
getFolders(BoxCollection collection)
Get folders in a collection.
|
BoxCollection |
getFolderTrashItems(java.lang.String folderId,
BoxFolderRequestObject requestObject)
Get the trashed items(subfolders, files, weblinks...) under a folder.
|
BoxFolder |
getTrashFolder(java.lang.String folderId,
BoxDefaultRequestObject requestObject)
Get trash folder given a folder id.
|
BoxFolder |
restoreTrashFolder(java.lang.String id,
BoxItemRestoreRequestObject requestObject)
Restore a trashed folder.
|
BoxFolder |
updateFolderInfo(java.lang.String folderId,
BoxFolderRequestObject requestObject)
Update info for a folder.
|
copyItem, createSharedLink, deleteTrashItem, getItem, getTrashItem, restoreTrashItem, updateItemInfo
executeRequestWithNoResponseBody, getAuth, getConfig, getJSONParser, getResourceHub, getResponseAndParse, getResponseAndParseAndTryCast, tryCastBoxItem, tryCastObject
public BoxFoldersManager(IBoxConfig config, IBoxResourceHub resourceHub, IBoxJSONParser parser, IBoxRequestAuth auth, IBoxRESTClient restClient)
config
- ConfigresourceHub
- IResourceHubparser
- json parserauth
- auth for api callsrestClient
- REST client to make api calls.public BoxFolder getFolder(java.lang.String folderId, BoxDefaultRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
folderId
- id of the folderrequestObject
- object that goes into request.BoxRestException
- exceptionBoxServerException
- exceptionAuthFatalFailureException
- exception indicating authentication totally failedpublic BoxFolder getTrashFolder(java.lang.String folderId, BoxDefaultRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
folderId
- id of the folderrequestObject
- object that goes into request.BoxRestException
- exceptionBoxServerException
- exceptionAuthFatalFailureException
- exception indicating authentication totally failedpublic BoxFolder createFolder(BoxFolderRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
requestObject
- request objectBoxRestException
- exceptionBoxServerException
- exceptionAuthFatalFailureException
- exception indicating authentication totally failedpublic void deleteFolder(java.lang.String folderId, BoxFolderRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
folderId
- id of the folderrequestObject
- request objectBoxRestException
- exceptionBoxServerException
- exceptionAuthFatalFailureException
- exception indicating authenticating totally failedpublic void deleteTrashFolder(java.lang.String id, BoxFileRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
id
- id of the folderrequestObject
- request objectBoxRestException
AuthFatalFailureException
BoxServerException
public BoxFolder restoreTrashFolder(java.lang.String id, BoxItemRestoreRequestObject requestObject) throws BoxRestException, AuthFatalFailureException, BoxServerException
id
- id of the trashed folder.requestObject
- BoxRestException
AuthFatalFailureException
BoxServerException
public BoxFolder copyFolder(java.lang.String folderId, BoxFolderRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
folderId
- id of the folderrequestObject
- request objectBoxRestException
- exceptionBoxServerException
- exceptionAuthFatalFailureException
- exceptionpublic BoxCollection getFolderItems(java.lang.String folderId, BoxFolderRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
GetFolderItemsRequest#DEFAULT_FOLDER_ITEMS_LIMIT
items, at an offset of GetFolderItemsRequest#DEFAULT_FOLDER_ITEMS_OFFSET
folderId
- id of the folder.requestObject
- request objectBoxRestException
- exceptionBoxServerException
- exceptionAuthFatalFailureException
- exception indicating authentication totally failedpublic BoxCollection getFolderTrashItems(java.lang.String folderId, BoxFolderRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
GetFolderItemsRequest#DEFAULT_FOLDER_ITEMS_LIMIT
items, at an offset of GetFolderItemsRequest#DEFAULT_FOLDER_ITEMS_OFFSET
folderId
- id of the folder.requestObject
- request objectBoxRestException
- exceptionBoxServerException
- exceptionAuthFatalFailureException
- exception indicating authentication totally failedpublic BoxFolder updateFolderInfo(java.lang.String folderId, BoxFolderRequestObject requestObject) throws java.io.UnsupportedEncodingException, BoxRestException, BoxServerException, AuthFatalFailureException
fileFolderId
- id of the folderrequestObject
- request objectjava.io.UnsupportedEncodingException
- exceptionBoxRestException
- exceptionBoxServerException
- exceptionAuthFatalFailureException
- exception indicating authentication totally failedpublic BoxFolder createSharedLink(java.lang.String folderId, BoxFolderRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
fileFolderId
- id of the folderisFolder
- whether this is a folder.perm
- SharedLinkPermissionsaccess
- SharedLinkAccess, String can be the strings defined in BoxSharedLinkAccess
.unsharedAt
- the time the created shared link expires.BoxRestException
- exceptionBoxServerException
- exceptionAuthFatalFailureException
- exception indicating authentication totally failedpublic java.util.List<BoxCollaboration> getFolderCollaborations(java.lang.String folderId, BoxDefaultRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
folderId
- id of the folderBoxRestException
- exceptionBoxServerException
- exceptionAuthFatalFailureException
- exception indicating authentication totally failedpublic static java.util.List<BoxFolder> getFolders(BoxCollection collection)
collection
- collection