public class JsonConfigFile extends ConfigFile<ninja.leaping.configurate.ConfigurationNode>
ConfigFile for the JSON specification.| Modifier and Type | Field and Description |
|---|---|
private static org.slf4j.Logger |
LOGGER
The JsonConfigFile logger.
|
| Constructor and Description |
|---|
JsonConfigFile(java.nio.file.Path file,
ninja.leaping.configurate.loader.ConfigurationLoader<ninja.leaping.configurate.ConfigurationNode> loader,
ninja.leaping.configurate.ConfigurationNode root)
Constructs a new
JsonConfigFile. |
| Modifier and Type | Method and Description |
|---|---|
static JsonConfigFile |
load(java.nio.file.Path file)
Creates a
JsonConfigFile. |
static JsonConfigFile |
load(java.nio.file.Path file,
java.lang.String resource)
Creates a
JsonConfigFile. |
static JsonConfigFile |
load(java.nio.file.Path file,
java.lang.String resource,
boolean overwrite)
Creates a
JsonConfigFile. |
static JsonConfigFile |
load(java.nio.file.Path file,
java.lang.String resource,
boolean overwrite,
boolean merge)
Deprecated.
|
getFile, getFileDirectory, getLoader, getNode, getNode, getNode, reload, reloadWithException, save, saveWithExceptionpublic JsonConfigFile(@Nonnull
java.nio.file.Path file,
@Nonnull
ninja.leaping.configurate.loader.ConfigurationLoader<ninja.leaping.configurate.ConfigurationNode> loader,
@Nonnull
ninja.leaping.configurate.ConfigurationNode root)
JsonConfigFile.file - the location of the configuration file on diskloader - the active loaded for the configuration file on diskroot - the loaded ConfigurationNode at the root levelpublic static JsonConfigFile load(java.nio.file.Path file) throws java.io.IOException
JsonConfigFile.file - the location of the config file on diskJsonConfigFilejava.io.IOException - if files cannot be properly deleted/createdpublic static JsonConfigFile load(@Nonnull java.nio.file.Path file, @Nonnull java.lang.String resource) throws java.io.IOException
JsonConfigFile.
Also merges a configuration file from classpath into the file on disk.
file - the location of the config file on diskresource - the location of the resource in the classpathJsonConfigFilejava.io.IOException - if files cannot be properly deleted/createdpublic static JsonConfigFile load(@Nonnull java.nio.file.Path file, @Nullable java.lang.String resource, boolean overwrite) throws java.io.IOException
JsonConfigFile.
Also merges a configuration file from the classpath into the file on disk.
May delete file on disk before copying resource.
file - the location of the config file on diskresource - the location of the resource in the classpathoverwrite - whether or not to delete the file on disk before copying resourceJsonConfigFilejava.io.IOException - if files cannot be properly deleted/created@Deprecated public static JsonConfigFile load(@Nonnull java.nio.file.Path file, @Nullable java.lang.String resource, boolean overwrite, boolean merge) throws java.io.IOException
JsonConfigFile.
May merge a configuration file from the classpath into the file on disk.
May delete the file on disk before copying resource.
If accessing this method directly, keep in mind that passing true
for overwrite but false for merge is going
to result in a non-existent file on disk.
file - the location of the config file on diskresource - the location of the resource in the classpathoverwrite - whether or not to delete the file on disk before copying the resourcemerge - whether or not to merge the resource into the file on diskJsonConfigFilejava.io.IOException - if files cannot be properly deleted/created