public abstract class FileConfiguration extends MemoryConfiguration
Synchronized with the commit on 07-June-2022.
defs, options| Modifier | Constructor and Description |
|---|---|
protected |
FileConfiguration()
Constructs an empty file configuration with no default values.
|
protected |
FileConfiguration(@Nullable Configuration defs)
Constructs an empty file configuration using the given configuration as a
source for all default values.
|
| Modifier and Type | Method and Description |
|---|---|
@NotNull FileConfigurationOptions |
getOptions()
Gets the options for this configuration.
|
void |
load(@NotNull File file)
Loads this file configuration from the given file.
|
void |
load(@NotNull Reader reader)
Loads this file configuration from the given reader.
|
void |
load(@NotNull String path)
Loads this file configuration from the file at the given path.
|
abstract void |
loadFromString(@NotNull String data)
Loads this file configuration from the given string.
|
void |
save(@NotNull File file)
Saves this file configuration to the given file.
|
void |
save(@NotNull String path)
Saves this file configuration to the given file.
|
abstract @NotNull String |
saveToString()
Converts this file configuration to a string.
|
addDefault, addDefaults, addDefaults, getDefaults, getParent, setDefaultsclear, contains, contains, createPath, createPath, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByte, getByte, getByteList, getChar, getChar, getCharList, getComments, getConfigurationSection, getCurrentPath, getDefaultSection, getDouble, getDouble, getDoubleList, getFloat, getFloat, getFloatList, getInlineComments, getInt, getInt, getIntList, getKeys, getList, getList, getLong, getLong, getLongList, getMapList, getName, getObject, getObject, getRoot, getSerializable, getSerializable, getShort, getShort, getShortList, getString, getString, getStringList, getValues, isBoolean, isByte, isChar, isConfigurationSection, isDouble, isFloat, isInt, isList, isLong, isNumber, isSet, isShort, isString, set, setComments, setInlineComments, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontains, contains, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByte, getByte, getByteList, getChar, getChar, getCharList, getComments, getConfigurationSection, getCurrentPath, getDefaultSection, getDouble, getDouble, getDoubleList, getFloat, getFloat, getFloatList, getInlineComments, getInt, getInt, getIntList, getKeys, getList, getList, getLong, getLong, getLongList, getMapList, getName, getObject, getObject, getRoot, getSerializable, getSerializable, getShort, getShort, getShortList, getString, getString, getStringList, getValues, isBoolean, isByte, isChar, isConfigurationSection, isDouble, isFloat, isInt, isList, isLong, isNumber, isSet, isShort, isString, set, setComments, setInlineCommentsprotected FileConfiguration()
MemoryConfiguration()protected FileConfiguration(@Nullable
@Nullable Configuration defs)
defs - The default value provider configuration.MemoryConfiguration(Configuration)public final void save(@NotNull
@NotNull File file)
throws IOException
If the given file does not exist, it will attempt to be created. If it already exists, any contents will be overwritten, regardless of the old or new contents. If it cannot be created or overwritten, an I/O exception will be thrown.
This method will save using the UTF-8 charset.
file - The file to save to.IOException - If this file configuration cannot be written.saveToString()public final void save(@NotNull
@NotNull String path)
throws IOException
If the file at the given path does not exist, it will attempt to be created. If it already exists, any contents will be overwritten, regardless of the old or new contents. If it cannot be created or overwritten, an I/O exception will be thrown.
This method will save using the UTF-8 charset.
path - The path of the file to save to.IOException - If this file configuration cannot be written.save(File)@NotNull public abstract @NotNull String saveToString()
public final void load(@NotNull
@NotNull Reader reader)
throws IOException,
InvalidConfigurationException
All values contained in-memory in this file configuration will be removed, leaving only the file configuration options as well as any defaults. The new values will be loaded into memory from the given reader.
reader - The reader used to load this file configuration.IOException - If the given reader encounters an error.InvalidConfigurationException - If the data in the reader cannot be
parsed as a file configuration.loadFromString(String)public final void load(@NotNull
@NotNull File file)
throws IOException,
InvalidConfigurationException
All values contained in-memory in this file configuration will be removed, leaving only the file configuration options as well as any defaults. The new values will be loaded into memory from the given file.
file - The file used to load this file configuration.IOException - If the given file cannot be read.InvalidConfigurationException - If the data in the file cannot be
parsed as a file configuration.load(Reader)public final void load(@NotNull
@NotNull String path)
throws IOException,
InvalidConfigurationException
All values contained in-memory in this file configuration will be removed, leaving only the file configuration options as well as any defaults. The new values will be loaded into memory from the file at the given path.
path - The path of the file to load from.IOException - If the file cannot be read.InvalidConfigurationException - If the data in the file cannot be
parsed as a file configuration.load(File)public abstract void loadFromString(@NotNull
@NotNull String data)
throws InvalidConfigurationException
All values contained in-memory in this file configuration will be removed, leaving only the file configuration options as well as any defaults. The new values will be loaded into memory from the given string.
data - The string representation of the file configuration data to
load.InvalidConfigurationException - If the given string cannot be
parsed as a file configuration.@NotNull public @NotNull FileConfigurationOptions getOptions()
All setters through this method are chainable.
getOptions in interface ConfigurationgetOptions in class MemoryConfigurationCopyright © 2024 BSPF Systems, LLC. All rights reserved.