> For the complete documentation index, see [llms.txt](https://smuddgge.gitbook.io/squishy-library/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://smuddgge.gitbook.io/squishy-library/configuration/configuration-directory.md).

# Configuration Directory

{% tabs %}
{% tab title="Creation" %}
Load all files in a directory into one configuration section.

<pre class="language-java"><code class="lang-java">ConfigurationDirectory directory = new ConfigurationDirectory(new File("folder"));
// Load only the directory (true) or all directories inside it too (false).
<strong>directory.load(false);
</strong></code></pre>

{% endtab %}

{% tab title="Getting Values" %}

## Getting values

This is the same as a configuration file.

```java
String value = directory.getString("key");
```

{% endtab %}

{% tab title="Saving Values" %}

## Saving values

```java
// Save to only the directory (true) or all directories inside it too (false).
directory.save(false);
```

1. It will get the **old keys** from **all files**.
2. Loop through **new keys**, if exists save, otherwise save to `lost_keys.yml`.
3. If any **old keys** were missed, delete them.
   {% endtab %}
   {% endtabs %}

***

{% tabs %}
{% tab title="Get Directory" %}

```java
File folder = directory.getDirectory();
File folder = directory.getDirectory("path/path");
```

```java
String name = getDirectoryName();
```

{% endtab %}

{% tab title="Resource/Default Files" %}

```java
directory.addResourcePath("path_from_resource_folder");

List<String> resources = directory.getResourcePathList();
 
directory.removeResourcePath("path_from_resource_folder");

directory.clearResourcePathList();
```

Resource paths will be loaded if the resource doesn't exist in the directory.
{% endtab %}

{% tab title="Datastore" %}

```java
Configuration store = directory.getDataStore();
```

A `YAML` configuration file that can be used to store info about the directory.\
This configuration file won't be loaded as part of the directory.
{% endtab %}
{% endtabs %}
