Skip to content

Commit b9d3556

Browse files
authored
Update README.md
Added getByPath sample method in code.
1 parent f3915a7 commit b9d3556

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,16 @@ getConfigurationProvider().registerWithDefaults(
154154
```java
155155
import dev.spexx.configurationAPI.api.config.yaml.YamlConfig;
156156
157+
// Option 1 - by File
157158
YamlConfig config = getConfigurationProvider().get(
158159
new File(getDataFolder(), "config.yml")
159160
);
160161
162+
// Option 2 - by path (String) relative or absolute
163+
164+
YamlConfig config = getConfigurationProvider()
165+
.getByPath("plugins/MyPlugin/config.yml);
166+
161167
String value = config.get().getString("path.to.value");
162168
```
163169
> 💡 Prefer get(File) over getByPath(String) for better reliability.

0 commit comments

Comments
 (0)