Using an integrated yaml file to premake config files.

Discussion in 'Plugin Development' started by DutchJellyV2, Apr 11, 2018.

Thread Status:
Not open for further replies.
  1. Offline

    DutchJellyV2

    Hi,

    I've been trying to create a yamlfile in my project with some preset stuff to eventually get a more clean way of making a clean premade config file. However, I don't know how to acces this file. I do know that I want to use the Files.copy(from,to) method. I hope someone knows what the directory of a yamlfile inside my project is. Bukkit is also able to acces the plugin.yml file so why couldn't I acces my config.yml file to preset it!

    [EDIT]
    Do clearify: the file I'm trying to use is in the src folder of my project.
     
    Last edited: Apr 11, 2018
  2. Offline

    Zombie_Striker

    @DutchJellyV2
    If the premade YML file is the config.yml, you can use saveDefaultConfig() to copy over that file.

    For other YML files, you will need to use the Files.copy method or an Input/Output stream for the file.
     
  3. Offline

    RcExtract

    doing Plugin.getResource(String) returns a file with the specified name in the main directory inside ur jar file.
    Ex.
    SimplePlugin.jar
    |_ resources.yml
    |_ src
    You can do Plugin.getResource("resources.yml"); to obtain the file.
     
  4. Offline

    DutchJellyV2

    Ok thanks, that's what I needed to know :) Sorry for being unclear about it.
     
Thread Status:
Not open for further replies.

Share This Page