public class YamlFile extends YamlConfiguration implements org.simpleyaml.configuration.comments.Commentable
YamlConfiguration
which saves all data in Yaml to a configuration file
with the added possibility to save and manage comments.
Note that this implementation is not synchronized.yamlImplementation
Constructor and Description |
---|
YamlFile()
Builds this
YamlFile without any configuration file. |
YamlFile(File file)
Builds this
FileConfiguration with a source file. |
YamlFile(String path)
Builds this
FileConfiguration with the file specified by path. |
YamlFile(URI uri)
Builds this
FileConfiguration with the file specified by uri. |
YamlFile(URL url)
Builds this
FileConfiguration with the file specified by url. |
YamlFile(YamlImplementation yamlImplementation)
Builds this
YamlFile without any configuration file. |
Modifier and Type | Method and Description |
---|---|
void |
copyTo(File file)
Copy this configuration file to another file, without deleting configuration file.
|
File |
copyTo(String path)
Copy this configuration file to another path, without deleting configuration file.
|
void |
createNewFile()
Creates a new empty file atomically for this configuration file if and only if it does not already exist.
|
void |
createNewFile(boolean overwrite)
Creates a new empty file atomically for this configuration file.
|
void |
createOrLoad()
If this configuration file does not exist then it is created along with missing parent directories.
|
void |
createOrLoadWithComments()
If this configuration file does not exist then it is created along with missing parent directories.
|
void |
deleteFile()
Deletes this configuration file from disk.
|
boolean |
exists()
Tests whether this configuration file exists.
|
String |
fileToString()
Returns a representation of the already saved configuration file.
|
String |
getComment(String path)
Retrieve the block comment of the section or value selected by path.
|
String |
getComment(String path,
org.simpleyaml.configuration.comments.CommentType type)
Retrieve the comment of the section or value selected by path.
|
String |
getComment(String path,
org.simpleyaml.configuration.comments.CommentType type,
YamlCommentFormat yamlCommentFormat)
Retrieve the comment of the section or value selected by path.
|
String |
getComment(String path,
org.simpleyaml.configuration.comments.CommentType type,
YamlCommentFormatter yamlCommentFormatter)
Retrieve the comment of the section or value selected by path.
|
String |
getComment(String path,
YamlCommentFormat yamlCommentFormat)
Retrieve the block comment of the section or value selected by path.
|
String |
getComment(String path,
YamlCommentFormatter yamlCommentFormatter)
Retrieve the block comment of the section or value selected by path.
|
YamlCommentMapper |
getCommentMapper()
Get the comment mapper.
|
File |
getConfigurationFile()
Returns this configuration file where data is located.
|
String |
getFilePath()
Returns the absolute pathname string of this configuration file.
|
String |
getFooter()
Gets the footer of this configuration file.
|
String |
getHeader()
Gets the header of this configuration file.
|
long |
getSize()
Returns the size of this configuration file.
|
void |
load()
Loads configurations from this configuration file.
|
void |
load(org.simpleyaml.utils.SupplierIO.Reader readerSupplier)
Loads this
YamlFile from the specified reader. |
static YamlFile |
loadConfiguration(File file)
Creates a new
YamlFile , loading from the given file (without comments). |
static YamlFile |
loadConfiguration(File file,
boolean withComments)
Creates a new
YamlFile , loading from the given file. |
static YamlFile |
loadConfiguration(InputStream stream)
Deprecated.
this method loads the entire file into memory, for larger files please use
loadConfiguration(SupplierIO.InputStream) |
static YamlFile |
loadConfiguration(InputStream stream,
boolean withComments)
Deprecated.
this method loads the entire file into memory, for larger files please use
loadConfiguration(SupplierIO.InputStream, boolean) |
static YamlFile |
loadConfiguration(Reader reader)
Deprecated.
this method loads the entire file into memory, for larger files please use
loadConfiguration(SupplierIO.Reader) |
static YamlFile |
loadConfiguration(Reader reader,
boolean withComments)
Deprecated.
this method loads the entire file into memory, for larger files please use
loadConfiguration(SupplierIO.Reader, boolean) |
static YamlFile |
loadConfiguration(org.simpleyaml.utils.SupplierIO.InputStream streamSupplier)
Creates a new
YamlFile , loading from the given stream (without comments). |
static YamlFile |
loadConfiguration(org.simpleyaml.utils.SupplierIO.InputStream streamSupplier,
boolean withComments)
Creates a new
YamlFile , loading from the given stream. |
static YamlFile |
loadConfiguration(org.simpleyaml.utils.SupplierIO.Reader readerSupplier)
Creates a new
YamlFile , loading from the given reader (without comments). |
static YamlFile |
loadConfiguration(org.simpleyaml.utils.SupplierIO.Reader readerSupplier,
boolean withComments)
Creates a new
YamlFile , loading from the given reader. |
static YamlFile |
loadConfigurationFromString(String contents)
Creates a new
YamlFile , loading from the specified string contents (without comments). |
static YamlFile |
loadConfigurationFromString(String contents,
boolean withComments)
Creates a new
YamlFile , loading from the specified string contents. |
void |
loadWithComments()
Loads configurations from this configuration file including comments.
|
YamlFileWrapper |
path(String path)
Get a wrapper builder to set a value to the given path and optionally set comments.
|
void |
save()
Saves this
FileConfiguration to the configuration file location. |
String |
saveToString()
Saves this
YamlFile to a string and returns it. |
void |
set(String path,
Object value)
Sets the specified path to the given value.
|
void |
setBlankLine(String path)
Set a blank line at the beginning of the block comment.
|
void |
setComment(String path,
String comment)
Set a block comment above the section or value selected by path.
|
void |
setComment(String path,
String comment,
org.simpleyaml.configuration.comments.CommentType type)
Set a comment to the section or value selected by path.
|
void |
setComment(String path,
String comment,
org.simpleyaml.configuration.comments.CommentType type,
YamlCommentFormat yamlCommentFormat)
Set a comment to the section or value selected by path.
|
void |
setComment(String path,
String comment,
org.simpleyaml.configuration.comments.CommentType type,
YamlCommentFormatter yamlCommentFormatter)
Set a comment to the section or value selected by path.
|
void |
setComment(String path,
String comment,
YamlCommentFormat yamlCommentFormat)
Set a block comment to the section or value selected by path.
|
void |
setComment(String path,
String comment,
YamlCommentFormatter yamlCommentFormatter)
Set a block comment to the section or value selected by path.
|
void |
setCommentFormat(YamlCommentFormat yamlCommentFormat)
Change the comment formatter to one of the defaults provided by
YamlCommentFormat . |
void |
setCommentFormat(YamlCommentFormatter yamlCommentFormatter)
Change the comment formatter for parsing and dumping comments.
|
void |
setConfigurationFile(File file)
Rebuilds this
FileConfiguration with a source file. |
void |
setConfigurationFile(String path)
Rebuilds this
FileConfiguration with the file specified by path. |
void |
setConfigurationFile(URI uri)
Rebuilds this
FileConfiguration with the file specified by uri. |
void |
setFooter(String footer)
Sets the footer of this configuration file.
|
void |
setHeader(String header)
Sets the header that will be applied to the top of the saved output.
|
protected void |
setListNode(Collection<?> value,
org.simpleyaml.configuration.comments.KeyTree.Node node) |
String |
toString()
Returns a representation of this configuration file.
|
dump, dump, get, getImplementation, load, load, load, load, loadFromString, loadHeader, options, save, set, setImplementation
buildHeader, load, save, save
addDefault, addDefaults, addDefaults, getDefaults, getParent, setDefaults
contains, createPath, createPath, createSection, createSection, get, getBoolean, getBoolean, getBooleanList, getByteList, getCharacterList, getConfigurationSection, getCurrentPath, getDefault, getDefaultSection, getDouble, getDouble, getDoubleList, getFloatList, getInt, getInt, getIntegerList, getKeys, getList, getList, getLong, getLong, getLongList, getMapList, getMapValues, getName, getRoot, getShortList, getString, getString, getStringList, getValues, isBoolean, isConfigurationSection, isDouble, isEmpty, isInt, isList, isLong, isPrimitiveWrapper, isSet, isString, mapChildrenKeys, mapChildrenValues, size
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
contains, createSection, createSection, get, getBoolean, getBoolean, getBooleanList, getByteList, getCharacterList, getConfigurationSection, getCurrentPath, getDefaultSection, getDouble, getDouble, getDoubleList, getFloatList, getInt, getInt, getIntegerList, getKeys, getList, getList, getLong, getLong, getLongList, getMapList, getMapValues, getName, getRoot, getShortList, getString, getString, getStringList, getValues, isBoolean, isConfigurationSection, isDouble, isEmpty, isInt, isList, isLong, isSet, isString, remove, size
public YamlFile()
YamlFile
without any configuration file.
In order to save changes you will have to use one of these methods before:
- setConfigurationFile(File)
- setConfigurationFile(String)
Or set the file when saving changes with FileConfiguration.save(File)
public YamlFile(YamlImplementation yamlImplementation)
YamlFile
without any configuration file.
In order to save changes you will have to use one of these methods before:
- setConfigurationFile(File)
- setConfigurationFile(String)
Or set the file when saving changes with FileConfiguration.save(File)
yamlImplementation
- the implementation to use. Default is SimpleYamlImplementation
,
but you can provide other like SnakeYamlImplementation
or a custom implementation.public YamlFile(String path) throws IllegalArgumentException
FileConfiguration
with the file specified by path.path
- location for the configuration fileIllegalArgumentException
- if path is null or is a directory.
IllegalArgumentException
is thrown then this
configuration file will be null.public YamlFile(File file) throws IllegalArgumentException
FileConfiguration
with a source file.file
- the configuration fileIllegalArgumentException
- if file is null or is a directory.
IllegalArgumentException
is thrown then this
configuration file will be null.public YamlFile(URI uri) throws IllegalArgumentException
FileConfiguration
with the file specified by uri.uri
- of the configuration fileIllegalArgumentException
- if file is null or is a directory.
IllegalArgumentException
is thrown then this
configuration file will be null.public YamlFile(URL url) throws IllegalArgumentException, URISyntaxException
FileConfiguration
with the file specified by url.url
- of the configuration fileURISyntaxException
- if this URL is not formatted strictly according to
RFC2396 and cannot be converted to a URI.IllegalArgumentException
- if file is null or is a directory.
IllegalArgumentException
is thrown then this
configuration file will be null.public void save() throws IOException
FileConfiguration
to the configuration file 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.
Comments copied will be those loaded with loadWithComments()
and those added
with setComment(String, String)
or setComment(String, String, CommentType)
.
This method will use the YamlConfiguration.options()
charset
encoding,
which defaults to UTF8.
IOException
- if it hasn't been possible to save configuration fileIllegalArgumentException
- if the configuration file is not setpublic String saveToString() throws IOException
YamlFile
to a string and returns it.
Comments copied will be those loaded with loadWithComments()
and those added
with setComment(String, String)
or setComment(String, String, CommentType)
.
saveToString
in interface org.simpleyaml.configuration.LoadableConfiguration
saveToString
in class YamlConfiguration
IOException
- if it hasn't been possible to save configuration filepublic void setComment(String path, String comment, org.simpleyaml.configuration.comments.CommentType type)
YamlConfiguration.options()
YamlConfigurationOptions.commentFormatter()
.setComment
in interface org.simpleyaml.configuration.comments.Commentable
path
- path of desired section or keycomment
- the comment to add, # prefix is not neededtype
- either above (BLOCK) or SIDEpublic void setComment(String path, String comment)
YamlConfiguration.options()
YamlConfigurationOptions.commentFormatter()
.setComment
in interface org.simpleyaml.configuration.comments.Commentable
path
- path of desired section or keycomment
- the block comment to add, # character is not neededpublic void setComment(String path, String comment, org.simpleyaml.configuration.comments.CommentType type, YamlCommentFormatter yamlCommentFormatter)
YamlCommentFormatter
.path
- path of desired section or keycomment
- the comment to add, # prefix is not neededtype
- either above (BLOCK) or SIDEyamlCommentFormatter
- the comment formatter to usepublic void setComment(String path, String comment, org.simpleyaml.configuration.comments.CommentType type, YamlCommentFormat yamlCommentFormat)
YamlCommentFormat
.path
- path of desired section or keycomment
- the comment to add, # prefix is not neededtype
- either above (BLOCK) or SIDEyamlCommentFormat
- the comment format to usepublic void setComment(String path, String comment, YamlCommentFormatter yamlCommentFormatter)
YamlCommentFormatter
.path
- path of desired section or keycomment
- the block comment to add, # prefix is not neededyamlCommentFormatter
- the comment formatter to usepublic void setComment(String path, String comment, YamlCommentFormat yamlCommentFormat)
YamlCommentFormat
.path
- path of desired section or keycomment
- the block comment to add, # prefix is not neededyamlCommentFormat
- the comment format to usepublic void setBlankLine(String path)
path
- path of desired section or keypublic String getComment(String path, org.simpleyaml.configuration.comments.CommentType type)
YamlConfiguration.options()
YamlConfigurationOptions.commentFormatter()
.getComment
in interface org.simpleyaml.configuration.comments.Commentable
path
- path of desired section or keytype
- either above (BLOCK) or SIDEpublic String getComment(String path)
YamlConfiguration.options()
YamlConfigurationOptions.commentFormatter()
.getComment
in interface org.simpleyaml.configuration.comments.Commentable
path
- path of desired section or keypublic String getComment(String path, org.simpleyaml.configuration.comments.CommentType type, YamlCommentFormatter yamlCommentFormatter)
YamlCommentFormatter
.path
- path of desired section or keytype
- either above (BLOCK) or SIDEyamlCommentFormatter
- the comment formatter to usepublic String getComment(String path, org.simpleyaml.configuration.comments.CommentType type, YamlCommentFormat yamlCommentFormat)
YamlCommentFormat
.path
- path of desired section or keytype
- either above (BLOCK) or SIDEyamlCommentFormat
- the comment format to usepublic String getComment(String path, YamlCommentFormatter yamlCommentFormatter)
YamlCommentFormatter
.path
- path of desired section or keyyamlCommentFormatter
- the comment formatter to usepublic String getComment(String path, YamlCommentFormat yamlCommentFormat)
YamlCommentFormat
.path
- path of desired section or keyyamlCommentFormat
- the comment format to usepublic void setCommentFormat(YamlCommentFormat yamlCommentFormat)
YamlCommentFormat
.
This will change the behaviour for parsing comments with getComment(String, CommentType)
and for dumping comments with setComment(String, String, CommentType)
.
If default behaviour does not suits you then change the format before calling one of these methods.yamlCommentFormat
- desired format to set/dump and get/parse commentspublic void setCommentFormat(YamlCommentFormatter yamlCommentFormatter)
YamlConfiguration.options()
YamlConfigurationOptions.commentFormatter(YamlCommentFormatter)
.
This will change the behaviour for parsing comments with getComment(String, CommentType)
and for dumping comments with setComment(String, String, CommentType)
.yamlCommentFormatter
- desired formatter to set/dump and get/parse commentspublic String getHeader()
YamlConfiguration.options()
YamlConfigurationOptions.headerFormatter()
.
By default the YamlHeaderFormatter
is used and the result string will not have a blank line at the end.
Null is a valid value which will indicate that no header is applied.
The default value is null.public void setHeader(String header)
YamlConfiguration.options()
YamlConfigurationOptions.header(String)
.
This header will be commented out and applied directly at the top of
the generated output of this configuration file.
The rules of YamlConfiguration.options()
YamlConfigurationOptions.headerFormatter()
will be respected.
By default the YamlHeaderFormatter
is used and the header will have a blank line written at the end of the header in the file.
It is not required to include a newline at the end of the header as it will
automatically be applied, but you may include one if you wish for extra spacing.
Null is a valid value which will indicate that no header is to be applied.header
- New headerpublic String getFooter()
getComment(String)
with null path.
The string format will respect the rules of the YamlConfiguration.options()
YamlConfigurationOptions.commentFormatter()
.
Null is a valid value which will indicate that no footer is applied.
The default value is null.public void setFooter(String footer)
setComment(String, String)
with null path.
This footer will be commented out and applied at the bottom of the generated output of this configuration file.
The end of the file will have a new line character '\n'.
The rules of YamlConfiguration.options()
YamlConfigurationOptions.commentFormatter()
will be respected.
Null is a valid value which will indicate that no footer is applied.footer
- the footer comment to write at the end of the filepublic YamlFileWrapper path(String path)
yamlFile.set("test.hello", "Hello");
yamlFile.setComment("test.hello", "Block comment");
yamlFile.setComment("test.hello", "Side comment", CommentType.SIDE);
You can achieve the same with:
yamlFile.path("test.hello")
.set("Hello")
.comment("Block comment")
.commentSide("Side comment");
path
- path of the object or configuration to setpublic YamlCommentMapper getCommentMapper()
getComment(String, CommentType)
,
setComment(String, String, CommentType)
public void set(String path, Object value)
YamlConfiguration
If value is null, the entry will be removed. Any existing entry will be replaced, regardless of what the new value is.
Some implementations may have limitations on what you may store. See
their individual javadocs for details. No implementations should allow
you to store Configuration
s or ConfigurationSection
s,
please use MemorySection.createSection(String)
for that.
set
in interface org.simpleyaml.configuration.ConfigurationSection
set
in class YamlConfiguration
path
- Path of the object to set.value
- New value to set the path to.protected void setListNode(Collection<?> value, org.simpleyaml.configuration.comments.KeyTree.Node node)
public void load() throws org.simpleyaml.exceptions.InvalidConfigurationException, IOException
This method will use the YamlConfiguration.options()
charset
encoding,
which defaults to UTF8.
Note that this method will not load comments of original configuration file,
if needed use loadWithComments()
instead.
IOException
- if it hasn't been possible to load fileorg.simpleyaml.exceptions.InvalidConfigurationException
- if there has been an error while parsing configuration fileFileNotFoundException
- if configuration file is not foundloadWithComments()
public void loadWithComments() throws org.simpleyaml.exceptions.InvalidConfigurationException, IOException
This method will use the YamlConfiguration.options()
charset
encoding,
which defaults to UTF8.
Use load()
instead to improve performance when configuration file has no comments or don't need it.
IOException
- if it hasn't been possible to load fileorg.simpleyaml.exceptions.InvalidConfigurationException
- if there has been an error while parsing configuration fileFileNotFoundException
- if configuration file is not foundload()
public void load(org.simpleyaml.utils.SupplierIO.Reader readerSupplier) throws IOException, org.simpleyaml.exceptions.InvalidConfigurationException
YamlFile
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.
If the file cannot be loaded for any reason, an exception will be thrown.
load
in class YamlConfiguration
readerSupplier
- a function providing the reader to load from (new instance)IOException
- Thrown when underlying reader throws an IOException.org.simpleyaml.exceptions.InvalidConfigurationException
- Thrown when the reader does not represent a valid Configuration.IllegalArgumentException
- Thrown when reader is null.public void createOrLoad() throws IOException, org.simpleyaml.exceptions.InvalidConfigurationException
Otherwise loads configurations from this configuration file.
This method will use the YamlConfiguration.options()
charset
encoding,
which defaults to UTF8.
IOException
- if it hasn't been possible to load fileorg.simpleyaml.exceptions.InvalidConfigurationException
- if there has been an error while parsing configuration fileFileNotFoundException
- if configuration file is not foundcreateOrLoadWithComments()
public void createOrLoadWithComments() throws IOException, org.simpleyaml.exceptions.InvalidConfigurationException
Otherwise loads configurations from this configuration file, including comments.
This method will use the YamlConfiguration.options()
charset
encoding,
which defaults to UTF8.
IOException
- if it hasn't been possible to load fileorg.simpleyaml.exceptions.InvalidConfigurationException
- if there has been an error while parsing configuration fileFileNotFoundException
- if configuration file is not foundcreateOrLoad()
public boolean exists()
true
if and only if this configuration file exists;
false
otherwisepublic void createNewFile(boolean overwrite) throws IOException
Parent directories will be created if they do not exist.
overwrite
- indicates if file must be overwritten if it already exists.
Note that if overwrite is set to false and there is already a file with that path file
will not be created and no exception is thrown.IOException
- if I/O error occurs creating the configuration filepublic void createNewFile() throws IOException
Parent directories will be created if they do not exist.
IOException
- if I/O error occurs creating the configuration filepublic void deleteFile() throws IOException
IOException
- if file cannot be deletedpublic long getSize()
public String getFilePath()
public File getConfigurationFile()
FileConfiguration
writes.public void setConfigurationFile(String path) throws IllegalArgumentException
FileConfiguration
with the file specified by path.path
- location for the configuration fileIllegalArgumentException
- if path is null or is a directory.
IllegalArgumentException
is thrown then this
configuration file will be null.public void setConfigurationFile(URI uri) throws IllegalArgumentException
FileConfiguration
with the file specified by uri.uri
- of the configuration fileIllegalArgumentException
- if file is null or is a directory.
IllegalArgumentException
is thrown then this
configuration file will be null.public void setConfigurationFile(File file) throws IllegalArgumentException
FileConfiguration
with a source file.file
- the configuration fileIllegalArgumentException
- if file is null or is a directory.
IllegalArgumentException
is thrown then this
configuration file will be null.public File copyTo(String path) throws FileNotFoundException, IllegalArgumentException, IOException
path
- the location of the new file, including name (mustn't be a directory)FileNotFoundException
- if configuration file is not found as source to copyIllegalArgumentException
- if path is a directory or it is nullIOException
- if there I/O error occurs copying filepublic void copyTo(File file) throws FileNotFoundException, IllegalArgumentException, IOException
file
- destination file (mustn't be a directory)FileNotFoundException
- if configuration file is not found as source to copyIllegalArgumentException
- if path is a directory or it is nullIOException
- if there I/O error occurs copying filepublic String fileToString() throws IOException
IOException
- if configuration file cannot be readpublic String toString()
toString
in class org.simpleyaml.configuration.MemorySection
public static YamlFile loadConfiguration(File file, boolean withComments) throws IOException
YamlFile
, loading from the given file.
This method will use the YamlConfiguration.options()
charset
encoding,
which defaults to UTF8.
file
- Input filewithComments
- if comments should be parsedIOException
- if configuration cannot be loadedIllegalArgumentException
- if file is nullpublic static YamlFile loadConfiguration(File file) throws IOException
YamlFile
, loading from the given file (without comments).
This method will use the YamlConfiguration.options()
charset
encoding,
which defaults to UTF8.
file
- Input fileIOException
- if configuration cannot be loadedIllegalArgumentException
- if file is nullloadConfiguration(File, boolean)
public static YamlFile loadConfigurationFromString(String contents, boolean withComments) throws IOException
YamlFile
, loading from the specified string contents.
If the file cannot be loaded for any reason, an exception will be thrown.
contents
- the contents to load fromwithComments
- if comments should be parsedIOException
- if underlying reader throws an IOException.org.simpleyaml.exceptions.InvalidConfigurationException
- if the contents does not represent a valid Configuration.IllegalArgumentException
- if contents is null.public static YamlFile loadConfigurationFromString(String contents) throws IOException
YamlFile
, loading from the specified string contents (without comments).
If the file cannot be loaded for any reason, an exception will be thrown.
contents
- the contents to load fromIOException
- if underlying reader throws an IOException.org.simpleyaml.exceptions.InvalidConfigurationException
- if the contents does not represent a valid Configuration.IllegalArgumentException
- if contents is null.public static YamlFile loadConfiguration(org.simpleyaml.utils.SupplierIO.Reader readerSupplier, boolean withComments) throws IOException
YamlFile
, loading from the given reader.readerSupplier
- reader supplierwithComments
- if comments should be parsedIOException
- if configuration cannot be loadedIllegalArgumentException
- if stream is nullpublic static YamlFile loadConfiguration(org.simpleyaml.utils.SupplierIO.Reader readerSupplier) throws IOException
YamlFile
, loading from the given reader (without comments).readerSupplier
- reader supplierIOException
- if configuration cannot be loadedIllegalArgumentException
- if stream is nullpublic static YamlFile loadConfiguration(org.simpleyaml.utils.SupplierIO.InputStream streamSupplier, boolean withComments) throws IOException
YamlFile
, loading from the given stream.
This method will use the YamlConfiguration.options()
charset
encoding,
which defaults to UTF8.
streamSupplier
- input stream supplierwithComments
- if comments should be parsedIOException
- if configuration cannot be loadedIllegalArgumentException
- if stream is nullpublic static YamlFile loadConfiguration(org.simpleyaml.utils.SupplierIO.InputStream streamSupplier) throws IOException
YamlFile
, loading from the given stream (without comments).
This method will use the YamlConfiguration.options()
charset
encoding,
which defaults to UTF8.
streamSupplier
- input stream supplierIOException
- if configuration cannot be loadedIllegalArgumentException
- if stream is null@Deprecated public static YamlFile loadConfiguration(InputStream stream, boolean withComments) throws IOException
loadConfiguration(SupplierIO.InputStream, boolean)
IOException
@Deprecated public static YamlFile loadConfiguration(InputStream stream) throws IOException
loadConfiguration(SupplierIO.InputStream)
IOException
@Deprecated public static YamlFile loadConfiguration(Reader reader, boolean withComments) throws IOException
loadConfiguration(SupplierIO.Reader, boolean)
IOException
@Deprecated public static YamlFile loadConfiguration(Reader reader) throws IOException
loadConfiguration(SupplierIO.Reader)
IOException
Copyright © 2023. All rights reserved.