public interface ConfigProvider
| Modifier and Type | Method and Description |
|---|---|
boolean |
exists() |
static PathConfigProvider |
file(java.io.File file)
Create a new
PathConfigProvider with the given file. |
java.lang.String |
load()
Load the content of the config file.
|
static MemoryConfigProvider |
memory(java.lang.String content,
java.util.function.Consumer<java.lang.String> contentConsumer)
Create a new
MemoryConfigProvider with the given content and consumer. |
static MemoryConfigProvider |
memory(java.util.function.Supplier<java.lang.String> contentSupplier,
java.util.function.Consumer<java.lang.String> contentConsumer)
Create a new
MemoryConfigProvider with the given content supplier and consumer. |
static PathConfigProvider |
path(java.nio.file.Path path)
Create a new
PathConfigProvider with the given path. |
void |
save(java.lang.String content)
Save the content to the config file.
|
static PathConfigProvider file(java.io.File file)
PathConfigProvider with the given file.file - The file to the config filePathConfigProviderstatic PathConfigProvider path(java.nio.file.Path path)
PathConfigProvider with the given path.path - The path to the config filePathConfigProviderstatic MemoryConfigProvider memory(java.lang.String content, java.util.function.Consumer<java.lang.String> contentConsumer)
MemoryConfigProvider with the given content and consumer.content - The content of the config filecontentConsumer - The consumer to set the contentMemoryConfigProviderstatic MemoryConfigProvider memory(java.util.function.Supplier<java.lang.String> contentSupplier, java.util.function.Consumer<java.lang.String> contentConsumer)
MemoryConfigProvider with the given content supplier and consumer.contentSupplier - The supplier to get the contentcontentConsumer - The consumer to set the contentMemoryConfigProviderjava.lang.String load()
throws java.io.IOException
java.io.IOException - If an I/O error occursvoid save(java.lang.String content) throws java.io.IOException
content - The content to savejava.io.IOException - If an I/O error occursboolean exists()