Solved InputStream and configs

Discussion in 'Spigot Plugin Development' started by titivermeesch, Jul 28, 2018.

  1. Hi there,

    I've just seen that this function don't work anymore, it's part of an old project that I didn't finished.
    Is there a function to transform an InputStream to a File?

    Code :
    Code (Java):
    public void reloadConfig() {
            if (arenaFile == null) {
                arenaFile = new File(plugin.getDataFolder(), "chests.yml");
            }
            arenaConfig = YamlConfiguration.loadConfiguration(arenaFile);

            InputStream defConfigStream = plugin.getResource("chests.yml");
           
            if (defConfigStream != null) {
                YamlConfiguration defConfig = YamlConfiguration.loadConfiguration(defConfigStream);
                arenaConfig.setDefaults(defConfig);
            }
        }