<commit_before>Folders
=======

Folder objects represent a folder from a user's account. They can be used to
iterate through a folder's contents, collaborate a folder with another user or
group, and perform other common folder operations (move, copy, delete, etc.).

* [Get the User's Root Folder](#get-the-users-root-folder)
* [Get a Folder's Items](#get-a-folders-items)
* [Get a Folder's Information](#get-a-folders-information)
* [Update a Folder's Information](#update-a-folders-information)
* [Create a Folder](#create-a-folder)
* [Copy a Folder](#copy-a-folder)
* [Move a Folder](#move-a-folder)
* [Rename a Folder](#rename-a-folder)
* [Delete a Folder](#delete-a-folder)
* [Created a Shared Link for a Folder](#created-a-shared-link-for-a-folder)
* [Share a Folder](#share-a-folder)
* [Get All Collaborations for a Folder](#get-all-collaborations-for-a-folder)

Get the User's Root Folder
--------------------------

The user's root folder can be accessed with the static
[`getRootFolder(BoxAPIConnection)`][get-root-folder] method.

```java
BoxFolder rootFolder = BoxFolder.getRootFolder(api);
```

[get-root-folder]: https://box.github.io/box-java-sdk/javadoc/com/box/sdk/BoxFolder.html#getRootFolder(com.box.sdk.BoxAPIConnection)

Get a Folder's Items
--------------------

Every `BoxFolder` implements [`Iterable<BoxItem>`][iterator] which allows you to
iterate over the folder's contents. The iterator automatically handles paging
and will make additional network calls to load more data from Box when
necessary.

```java
BoxFolder folder = new BoxFolder(api, "id");
for (BoxItem.Info itemInfo : folder) {
    if (itemInfo instanceof BoxFile.Info) {
        BoxFile.Info fileInfo = (BoxFile.Info) itemInfo;
        // Do something with the file.
    } else if (itemInfo instanceof BoxFolder) {
        BoxFolder.Info folderInfo = (BoxFolder.Info) itemInfo;
        // Do something with the folder.
    }
}
```

`BoxFolder` purposely doesn't provide a way of getting a collection of
`BoxItems`. Getting the entire contents of a folder is usually unnecessary and
can be extremely inefficient for folders with a large number of items. If you
really require a collection instead of an iterable, you can create the<commit_msg>Fix code typo in folders documentation<commit_after>Folders
=======

Folder objects represent a folder from a user's account. They can be used to
iterate through a folder's contents, collaborate a folder with another user or
group, and perform other common folder operations (move, copy, delete, etc.).

* [Get the User's Root Folder](#get-the-users-root-folder)
* [Get a Folder's Items](#get-a-folders-items)
* [Get a Folder's Information](#get-a-folders-information)
* [Update a Folder's Information](#update-a-folders-information)
* [Create a Folder](#create-a-folder)
* [Copy a Folder](#copy-a-folder)
* [Move a Folder](#move-a-folder)
* [Rename a Folder](#rename-a-folder)
* [Delete a Folder](#delete-a-folder)
* [Created a Shared Link for a Folder](#created-a-shared-link-for-a-folder)
* [Share a Folder](#share-a-folder)
* [Get All Collaborations for a Folder](#get-all-collaborations-for-a-folder)

Get the User's Root Folder
--------------------------

The user's root folder can be accessed with the static
[`getRootFolder(BoxAPIConnection)`][get-root-folder] method.

```java
BoxFolder rootFolder = BoxFolder.getRootFolder(api);
```

[get-root-folder]: https://box.github.io/box-java-sdk/javadoc/com/box/sdk/BoxFolder.html#getRootFolder(com.box.sdk.BoxAPIConnection)

Get a Folder's Items
--------------------

Every `BoxFolder` implements [`Iterable<BoxItem>`][iterator] which allows you to
iterate over the folder's contents. The iterator automatically handles paging
and will make additional network calls to load more data from Box when
necessary.

```java
BoxFolder folder = new BoxFolder(api, "id");
for (BoxItem.Info itemInfo : folder) {
    if (itemInfo instanceof BoxFile.Info) {
        BoxFile.Info fileInfo = (BoxFile.Info) itemInfo;
        // Do something with the file.
    } else if (itemInfo instanceof BoxFolder.Info) {
        BoxFolder.Info folderInfo = (BoxFolder.Info) itemInfo;
        // Do something with the folder.
    }
}
```

`BoxFolder` purposely doesn't provide a way of getting a collection of
`BoxItems`. Getting the entire contents of a folder is usually unnecessary and
can be extremely inefficient for folders with a large number of items. If you
really require a collection instead of an iterable, you can create the
{'fraction_non_alphanumeric': 0.13228101378390394, 'fraction_numerical': 0.0, 'mean_word_length': 4.1066969353007945, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3895788', 'n_tokens_mistral': 1378, 'n_tokens_neox': 1296, 'n_words': 466}