public final class StrikeConfig
extends YamlDocument
| Constructor and Description |
|---|
StrikeConfig(@NotNull java.io.File document,
@Nullable java.io.InputStream defaults)
Constructs a new instance of
StrikeConfig. |
StrikeConfig(@NotNull java.io.File document,
@Nullable java.io.InputStream defaults,
boolean autoUpdate)
Constructs a new instance of
StrikeConfig. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
reload()
Reloads the configuration from the associated YAML file.
|
boolean |
reload(java.lang.String message)
Reloads the configuration from the associated YAML file with an optional custom error message.
|
boolean |
save()
Saves the current configuration to the associated YAML file.
|
boolean |
save(java.lang.String message)
Saves the current configuration to the associated YAML file with an optional custom error message.
|
public StrikeConfig(@NotNull
@NotNull java.io.File document,
@Nullable
@Nullable java.io.InputStream defaults)
throws java.io.IOException
StrikeConfig.document - The YAML configuration file to be loaded or created.defaults - An optional input stream containing default configuration data.
This data is used if the specified configuration file is not found.java.io.IOException - Thrown if there are issues reading or creating the configuration file.public StrikeConfig(@NotNull
@NotNull java.io.File document,
@Nullable
@Nullable java.io.InputStream defaults,
boolean autoUpdate)
throws java.io.IOException
StrikeConfig.document - The YAML configuration file to be loaded or created.defaults - An optional input stream containing default configuration data.
This data is used if the specified configuration file is not found.java.io.IOException - Thrown if there are issues reading or creating the configuration file.public boolean save()
true if the save operation is successful, otherwise false.public boolean save(java.lang.String message)
message - Custom error message to be included in case of an exception.true if the save operation is successful, otherwise a RuntimeException is thrown with the specified error message.public boolean reload()
true if the reload operation is successful, otherwise a RuntimeException is thrown with a default error message.public boolean reload(java.lang.String message)
message - Custom error message to be included in case of an exception.true if the reload operation is successful, otherwise a RuntimeException is thrown with the specified error message.