Configuration, ConfigurationSectionYamlConfigurationpublic abstract class FileConfiguration extends MemoryConfiguration
Configurationdefaults, optionsmap| Constructor | Description | 
|---|---|
| FileConfiguration() | Creates an empty  FileConfigurationwith no default values. | 
| FileConfiguration(Configuration defaults) | Creates an empty  FileConfigurationusing the specifiedConfigurationas a source for all default values. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| protected abstract java.lang.String | buildHeader() | Compiles the header for this  FileConfigurationand returns the
 result. | 
| void | load(java.io.File file) | Loads this  FileConfigurationfrom the specified location. | 
| void | load(java.io.Reader reader) | Loads this  FileConfigurationfrom the specified reader. | 
| void | load(java.lang.String file) | Loads this  FileConfigurationfrom the specified location. | 
| abstract void | loadFromString(java.lang.String contents) | Loads this  FileConfigurationfrom the specified string, as
 opposed to from file. | 
| FileConfigurationOptions | options() | Gets the  ConfigurationOptionsfor thisConfiguration. | 
| void | save(java.io.File file) | Saves this  FileConfigurationto the specified location. | 
| void | save(java.lang.String file) | Saves this  FileConfigurationto the specified location. | 
| abstract java.lang.String | saveToString() | Saves this  FileConfigurationto a string, and returns it. | 
contains, contains, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByteList, getCharacterList, getColor, getColor, getConfigurationSection, getCurrentPath, getDefaultSection, getDouble, getDouble, getDoubleList, getFloatList, getInt, getInt, getIntegerList, getItemStack, getItemStack, getKeys, getList, getList, getLong, getLong, getLongList, getMapList, getName, getOfflinePlayer, getOfflinePlayer, getRoot, getSerializable, getSerializable, getShortList, getString, getString, getStringList, getValues, getVector, getVector, isBoolean, isColor, isConfigurationSection, isDouble, isInt, isItemStack, isList, isLong, isOfflinePlayer, isSet, isString, isVector, setaddDefault, addDefaults, addDefaults, getDefaults, getParent, setDefaultscontains, contains, createPath, createPath, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByteList, getCharacterList, getColor, getColor, getConfigurationSection, getCurrentPath, getDefault, getDefaultSection, getDouble, getDouble, getDoubleList, getFloatList, getInt, getInt, getIntegerList, getItemStack, getItemStack, getKeys, getList, getList, getLong, getLong, getLongList, getMapList, getName, getOfflinePlayer, getOfflinePlayer, getRoot, getSerializable, getSerializable, getShortList, getString, getString, getStringList, getValues, getVector, getVector, isBoolean, isColor, isConfigurationSection, isDouble, isInt, isItemStack, isList, isLong, isOfflinePlayer, isPrimitiveWrapper, isSet, isString, isVector, mapChildrenKeys, mapChildrenValues, set, toStringpublic FileConfiguration()
FileConfiguration with no default values.public FileConfiguration(Configuration defaults)
FileConfiguration using the specified Configuration as a source for all default values.defaults - Default value providerpublic void save(java.io.File file)
          throws java.io.IOException
FileConfiguration to the specified location.
 If the file does not exist, it will be created. If already exists, it will be overwritten. If it cannot be overwritten or created, an exception will be thrown.
This method will save using the system default encoding, or possibly using UTF8.
file - File to save to.java.io.IOException - Thrown when the given file cannot be written to for
     any reason.java.lang.IllegalArgumentException - Thrown when file is null.public void save(java.lang.String file)
          throws java.io.IOException
FileConfiguration to the specified location.
 If the file does not exist, it will be created. If already exists, it will be overwritten. If it cannot be overwritten or created, an exception will be thrown.
This method will save using the system default encoding, or possibly using UTF8.
file - File to save to.java.io.IOException - Thrown when the given file cannot be written to for
     any reason.java.lang.IllegalArgumentException - Thrown when file is null.public abstract java.lang.String saveToString()
FileConfiguration to a string, and returns it.public void load(java.io.File file)
          throws java.io.FileNotFoundException,
                 java.io.IOException,
                 InvalidConfigurationException
FileConfiguration from the specified location.
 All the values contained within this configuration will be removed, leaving only settings and defaults, and the new values will be loaded from the given file.
If the file cannot be loaded for any reason, an exception will be thrown.
file - File to load from.java.io.FileNotFoundException - Thrown when the given file cannot be
     opened.java.io.IOException - Thrown when the given file cannot be read.InvalidConfigurationException - Thrown when the given file is not
     a valid Configuration.java.lang.IllegalArgumentException - Thrown when file is null.public void load(java.io.Reader reader)
          throws java.io.IOException,
                 InvalidConfigurationException
FileConfiguration from the specified reader.
 All the values contained within this configuration will be removed, leaving only settings and defaults, and the new values will be loaded from the given stream.
reader - the reader to load fromjava.io.IOException - thrown when underlying reader throws an IOExceptionInvalidConfigurationException - thrown when the reader does not
      represent a valid Configurationjava.lang.IllegalArgumentException - thrown when reader is nullpublic void load(java.lang.String file)
          throws java.io.FileNotFoundException,
                 java.io.IOException,
                 InvalidConfigurationException
FileConfiguration from the specified location.
 All the values contained within this configuration will be removed, leaving only settings and defaults, and the new values will be loaded from the given file.
If the file cannot be loaded for any reason, an exception will be thrown.
file - File to load from.java.io.FileNotFoundException - Thrown when the given file cannot be
     opened.java.io.IOException - Thrown when the given file cannot be read.InvalidConfigurationException - Thrown when the given file is not
     a valid Configuration.java.lang.IllegalArgumentException - Thrown when file is null.public abstract void loadFromString(java.lang.String contents)
                             throws InvalidConfigurationException
FileConfiguration from the specified string, as
 opposed to from file.
 All the values contained within this configuration will be removed, leaving only settings and defaults, and the new values will be loaded from the given string.
If the string is invalid in any way, an exception will be thrown.
contents - Contents of a Configuration to load.InvalidConfigurationException - Thrown if the specified string is
     invalid.java.lang.IllegalArgumentException - Thrown if contents is null.protected abstract java.lang.String buildHeader()
FileConfiguration and returns the
 result.
 
 This will use the header from options() -> FileConfigurationOptions.header(), respecting the rules of FileConfigurationOptions.copyHeader() if set.
public FileConfigurationOptions options()
ConfigurationConfigurationOptions for this Configuration.
 All setters through this method are chainable.
options in interface Configurationoptions in class MemoryConfigurationCopyright © 2018. All rights reserved.