loadSqlConfiguration
Loads a SqlConfiguration from file, optionally storing a default example configuration if none exists.
The configuration file name is database.yml in the directory dataFolder. The file is stored and read in UTF-8 format. A legacy database.properties file is migrated to database.yml if the latter does not exist yet, and deleted after a successful migration. Migrated values are trimmed.
The keys url, user, and password are required. Their values are read as text, without type conversion, so a password like 007007 stays 007007. user and password are not trimmed; url is. The usual YAML rules still apply: quoted values are unescaped ('it''s' becomes it's), and a block value (| or >) keeps its final line break unless written as |- or >-. user and password may be empty or YAML null (~, null), which reads as empty. url may not be empty or YAML null.
If saveDefault is true, this method creates a default configuration with example properties if none exists. It also creates any parent directories required to store it.
Parameters
The plugins data folder root
Stores an example configuration if the file does not exist
Throws
if the configuration (or the legacy file to migrate) cannot be read, written, or is invalid