Search in sources :

Example 1 with ConfigurationProvider

use of net.md_5.bungee.config.ConfigurationProvider in project ChangeSkin by games647.

the class ChangeSkinCore method loadFile.

private Configuration loadFile(String fileName) throws IOException {
    Configuration defaults;
    ConfigurationProvider configProvider = ConfigurationProvider.getProvider(YamlConfiguration.class);
    try (InputStream defaultStream = getClass().getClassLoader().getResourceAsStream(fileName)) {
        defaults = configProvider.load(defaultStream);
    }
    Path file = plugin.getPluginFolder().resolve(fileName);
    try (Reader reader = Files.newBufferedReader(file)) {
        return configProvider.load(reader, defaults);
    }
}
Also used : Path(java.nio.file.Path) YamlConfiguration(net.md_5.bungee.config.YamlConfiguration) Configuration(net.md_5.bungee.config.Configuration) ConfigurationProvider(net.md_5.bungee.config.ConfigurationProvider) InputStream(java.io.InputStream) Reader(java.io.Reader)

Aggregations

InputStream (java.io.InputStream)1 Reader (java.io.Reader)1 Path (java.nio.file.Path)1 Configuration (net.md_5.bungee.config.Configuration)1 ConfigurationProvider (net.md_5.bungee.config.ConfigurationProvider)1 YamlConfiguration (net.md_5.bungee.config.YamlConfiguration)1