Creating a Configuration File

Examples of configuration creation

YAML

Creating a single configuration file

Example
// Create a new instance of the configuration.
Configuration configuration = new YamlConfiguration(
    new File("src/main/resources"), "test.yml"
);

// This file will be copied from the resources folder 
// if the configuration doesn't exist.
configuration.setDefaultPath("test_default.yml");

// Load the configuration file into memory.
configuration.load();

// Set a new value.
configuration.set("test", "test");

// Save the memory to the configuration file.
configuration.save();

Creating a configuration factory

TOML

Creating a single configuration file

Creating a configuration factory

Last updated