public class GsonConfigFile extends ConfigFile<ninja.leaping.configurate.ConfigurationNode>
ConfigFile for the GSON specification.| Modifier and Type | Field and Description |
|---|---|
private static org.slf4j.Logger |
LOGGER
The GsonConfigFile logger.
|
| Constructor and Description |
|---|
GsonConfigFile(java.nio.file.Path file,
ninja.leaping.configurate.loader.ConfigurationLoader<ninja.leaping.configurate.ConfigurationNode> loader,
ninja.leaping.configurate.ConfigurationNode root)
Constructs a new
GsonConfigFile. |
| Modifier and Type | Method and Description |
|---|---|
static GsonConfigFile |
load(java.nio.file.Path file)
Creates a
GsonConfigFile. |
static GsonConfigFile |
load(java.nio.file.Path file,
java.lang.String resource)
Creates a
GsonConfigFile. |
static GsonConfigFile |
load(java.nio.file.Path file,
java.lang.String resource,
boolean overwrite)
Creates a
GsonConfigFile. |
static GsonConfigFile |
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 GsonConfigFile(@Nonnull
java.nio.file.Path file,
@Nonnull
ninja.leaping.configurate.loader.ConfigurationLoader<ninja.leaping.configurate.ConfigurationNode> loader,
@Nonnull
ninja.leaping.configurate.ConfigurationNode root)
GsonConfigFile.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 GsonConfigFile load(java.nio.file.Path file) throws java.io.IOException
GsonConfigFile.file - the location of the config file on diskGsonConfigFilejava.io.IOException - if files cannot be properly deleted/createdpublic static GsonConfigFile load(@Nonnull java.nio.file.Path file, @Nonnull java.lang.String resource) throws java.io.IOException
GsonConfigFile.
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 classpathGsonConfigFilejava.io.IOException - if files cannot be properly deleted/createdpublic static GsonConfigFile load(@Nonnull java.nio.file.Path file, @Nullable java.lang.String resource, boolean overwrite) throws java.io.IOException
GsonConfigFile.
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 resourceGsonConfigFilejava.io.IOException - if files cannot be properly deleted/created@Deprecated public static GsonConfigFile load(@Nonnull java.nio.file.Path file, @Nullable java.lang.String resource, boolean overwrite, boolean merge) throws java.io.IOException
GsonConfigFile.
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 diskGsonConfigFilejava.io.IOException - if files cannot be properly deleted/created