@ThreadSafe public class Config extends ConfigSection
Constructor and Description |
---|
Config(File file)
Creates a new JSON configuration file using the file that may or may not exist
|
Config(Path path)
Creates a new JSON configuration file from NIO path
|
Config(Plugin plugin,
String fileName)
Creates a new configuration using the plugin's config direction
|
Config(String path)
Creates a new JSON configuration file from the String path
|
Modifier and Type | Method and Description |
---|---|
Config |
parentSection()
The section parent
|
Path |
path()
Gets the path to the configuration file
|
void |
reload()
Reloads the configuration
|
Config |
rootSection()
The JSON root from the parent
|
void |
save()
Saves the parent data
|
addList, addToList, asJsonObject, contains, entries, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getByte, getByte, getChar, getChar, getConfigSection, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getList, getObject, getString, getString, keys, remove, setBigDecimal, setBigInteger, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setObject, setString, values
public Config(Path path)
path
- the NIO path for file directorypublic Config(File file)
file
- the file to use as a JSON config, preferably suffixed with .json
public Config(String path)
path
- the pathpublic Path path()
public void save()
ConfigSection
save
in class ConfigSection
public Config rootSection()
ConfigSection
rootSection
in class ConfigSection
public Config parentSection()
ConfigSection
parentSection
in class ConfigSection
public void reload()
Copyright © 2016. All rights reserved.