Skip to content

Latest commit

 

History

History
45 lines (40 loc) · 1.28 KB

Folders.md

File metadata and controls

45 lines (40 loc) · 1.28 KB

Folders

Get Info about a Box Folder

BoxApiFolder folderApi = new BoxApiFolder(session);
BoxFolder folder = folderApi.getInfoRequest("folderId").send();

Get the items in a Box Folder

BoxApiFolder folderApi = new BoxApiFolder(session);
BoxListItems items = folderApi.getItemsRequest("folderId").send();

Update Properties of a Box Folder

BoxApiFolder folderApi = new BoxApiFolder(session);
BoxFolder updatedFolder = folderApi.getUpdateRequest("folderId")
        // Update properties.
        .setName("new file name")
        .setDescription("new file description")
        .send();

Delete a Box Folder

BoxApiFolder folderApi = new BoxApiFolder(session);
folderApi.getDeleteRequest("folderId")
        // Optional: By default the folder will be deleted including all the files/folders within.
        // Set 'recursive' to false to only allow for the deletion if the folder is empty.
        .setRecursive(false)
        .send();

Create a new Box Folder

BoxApiFolder folderApi = new BoxApiFolder(session);
BoxFolder newFolder = folderApi.getCreateRequest("parentFolderId", "New Folder Name").send();